-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
name: "Update Helm Chart Tag" | ||
name: "Update Helm Chart Version" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
new_version: | ||
description: 'New version to update' | ||
description: 'New version to update (ex: v0.20.4)' | ||
required: true | ||
type: string | ||
repository_dispatch: | ||
|
@@ -18,7 +18,6 @@ permissions: | |
env: | ||
CI_COMMIT_AUTHOR: bump-version-wf | ||
CI_COMMIT_EMAIL: [email protected] | ||
HELM_BRANCH: master | ||
HELM_BRANCH_MERGE: "feat(helm)/update-to-" | ||
CHART_FILE: charts/kestra/Chart.yaml | ||
|
||
|
@@ -31,46 +30,45 @@ jobs: | |
id: set-helm-version | ||
run: | | ||
if [ -n "${{ github.event.client_payload.new_version }}" ]; then | ||
echo "HELM_BRANCH_MERGE=${{ env.HELM_BRANCH_MERGE }}${{ github.event.client_payload.new_version }}" >> $GITHUB_ENV | ||
HELM_VERSION=${{ github.event.client_payload.new_version }} | ||
echo "HELM_VERSION=${{ github.event.client_payload.new_version }}" >> $GITHUB_ENV | ||
else | ||
echo "HELM_BRANCH_MERGE=${{ env.HELM_BRANCH_MERGE }}${{ github.event.client_payload.new_version }} >> $GITHUB_ENV | ||
HELM_VERSION=${{ inputs.new_version }} | ||
echo "HELM_VERSION=${{ inputs.new_version }}" >> $GITHUB_ENV | ||
fi | ||
echo "version: ${HELM_VERSION#v}" | ||
echo "appVersion: ${HELM_VERSION}" | ||
echo "HELM_BRANCH_MERGE: ${HELM_BRANCH_MERGE}" | ||
echo "HELM_CHART_VERSION=${HELM_VERSION#v}" >> $GITHUB_ENV | ||
- name: Checkout master branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.HELM_BRANCH }} | ||
|
||
ref: master | ||
- name: Update Tag in YAML File | ||
id: edit-chart-version | ||
env: | ||
HELM_VERSION: ${{ env.HELM_VERSION }} | ||
run: | | ||
git config user.name "${{ env.CI_COMMIT_AUTHOR }}" | ||
git config user.email "${{ env.CI_COMMIT_EMAIL }}" | ||
# Update the appVersion with the new tag | ||
yq e -i ".appVersion = \"${HELM_VERSION}\"" ${{ env.CHART_FILE }} | ||
yq e -i ".appVersion = \"${{ env.HELM_VERSION }}\"" ${{ env.CHART_FILE }} | ||
# Update the version with the new tag, removing the leading 'v' | ||
yq e -i ".version = \"${HELM_VERSION#v}\"" ${{ env.CHART_FILE }} | ||
yq e -i ".version = \"${{ env.HELM_CHART_VERSION }}\"" ${{ env.CHART_FILE }} | ||
git add ${{ env.CHART_FILE }} | ||
git commit -m "Update version to ${HELM_VERSION#v} and appVersion to ${HELM_VERSION}" | ||
git commit -m "Update version to ${{ env.HELM_CHART_VERSION }} and appVersion to ${{ env.HELM_VERSION }}" | ||
- name: Create Pull Request | ||
id: create-pr | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
token: ${{ secrets.GITHUB_ACCESS_TOKEN }} | ||
branch: ${{ env.HELM_BRANCH_MERGE }} | ||
branch: ${{ env.HELM_BRANCH_MERGE }}${{ env.HELM_VERSION }} | ||
delete-branch: true | ||
title: 'Helm chart update to ${HELM_VERSION#v}' | ||
title: 'Helm chart update to ${{ env.HELM_CHART_VERSION }}' | ||
body: | | ||
Helm Chart update to new version: | ||
- In ${{ env.CHART_FILE }} new version is ${HELM_VERSION#v} | ||
- In ${{ env.CHART_FILE }} new appVersion is ${HELM_VERSION} | ||
- Auto-generated by "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Action URL>" | ||
- In `${{ env.CHART_FILE }}` new `version` is ${{ env.HELM_CHART_VERSION }} | ||
- In `${{ env.CHART_FILE }}` new `appVersion` is ${{ env.HELM_VERSION }} | ||
- Auto-generated by [Action URL][1] | ||
[1]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
labels: | | ||
automated pr |