Skip to content

Commit

Permalink
fix(workflow): quotes (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoSaba authored Dec 11, 2024
1 parent a909c79 commit 3410938
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions .github/workflows/bump-version.yml
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:
Expand All @@ -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

Expand All @@ -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

0 comments on commit 3410938

Please sign in to comment.