From d7700b2b2410ce5409a1717296d6abc3eb47d32f Mon Sep 17 00:00:00 2001 From: sHa Date: Fri, 20 Mar 2026 18:31:35 +0200 Subject: [PATCH] Refactor GitHub Actions workflow to use updated image tag output; streamline chart version bump and appVersion setting --- .github/workflows/build.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b921cb8..9396ee2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,14 +9,13 @@ jobs: build: runs-on: ubuntu-latest permissions: - contents: write packages: write + outputs: + image_tag: ${{ steps.tag.outputs.value }} steps: - name: Checkout uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: Set image tag id: tag @@ -46,6 +45,18 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + update-chart: + runs-on: ubuntu-latest + needs: build + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Bump chart version and set appVersion id: chart run: | @@ -56,7 +67,7 @@ jobs: NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))" sed -i "s/^version: .*/version: $NEW_VERSION/" helm/Chart.yaml - sed -i "s/^appVersion: .*/appVersion: \"${{ steps.tag.outputs.value }}\"/" helm/Chart.yaml + sed -i "s/^appVersion: .*/appVersion: \"${{ needs.build.outputs.image_tag }}\"/" helm/Chart.yaml echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT @@ -65,9 +76,5 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add helm/Chart.yaml - if git diff --cached --quiet; then - echo "No changes to commit; skipping commit and push." - else - git commit -m "chore: chart ${{ steps.chart.outputs.version }}, appVersion ${{ steps.tag.outputs.value }} [skip ci]" - git push - fi + git commit -m "chore: chart ${{ steps.chart.outputs.version }}, appVersion ${{ needs.build.outputs.image_tag }} [skip ci]" + git push