Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create automate pr for release #10

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/dispatch-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Dispatch Update Version

on:

Check failure on line 3 in .github/workflows/dispatch-update.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[truthy]

Truthy value should be one of \[false, true]
repository_dispatch:
types: [update-version]

jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v4

- name: Extract tag name
run: echo "TAG_NAME=${{ github.event.client_payload.tag }}" >> $GITHUB_ENV

- name: Update version in Ansible configuration
run: |
TAG_NAME="${{ env.TAG_NAME#v }}"
sed -i -E "s/^node_image_version: 'v\.?[0-9]+\.[0-9]+\.[0-9]+[a-zA-Z0-9\-]*'/node_image_version: 'v${TAG_NAME}'/" group_vars/all.yml

# Commit and push changes
git checkout -b update-version-${{ env.TAG_NAME }}
git add .
git commit -m "Update version to ${TAG_NAME}"
git push origin update-version-${{ env.TAG_NAME }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: main
head: update-version-${{ env.TAG_NAME }}
title: "Update version to ${{ env.TAG_NAME }}"
body: "Automatically generated PR to update version to ${{ env.TAG_NAME }}"
Loading