From fb184790f24c4b94487ae24f8d2e4ff83a8b5870 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste DONNETTE Date: Tue, 29 Oct 2024 09:41:16 +0100 Subject: [PATCH] fix(action-pr): fixing release bot stuff --- .github/workflows/release.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 440e125..c145011 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,9 +8,7 @@ on: jobs: release-on-merge: - if: > - github.event.pull_request.merged == true && - contains(github.event.pull_request.labels.*.name, 'release') + if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - name: Checkout @@ -23,13 +21,27 @@ jobs: git config user.name "${{ github.actor }}" git config user.email "${{ github.actor }}@users.noreply.github.com" + - name: Check 'release' Label + id: check_release_label + run: | + labels=${{ toJSON(github.event.pull_request.labels) }} + echo "Labels de la PR : $labels" + if [[ "$labels" == *'"name":"release"'* ]]; then + echo "has_release_label=true" >> $GITHUB_ENV + else + echo "has_release_label=false" >> $GITHUB_ENV + fi + - name: Lint Chart - Main chart + if: env.has_release_label == 'true' run: helm lint . - name: Update Dependencies + if: env.has_release_label == 'true' run: helm dependency update . - name: Run chart-releaser + if: env.has_release_label == 'true' uses: helm/chart-releaser-action@v1.6.0 with: config: cr.yaml @@ -37,6 +49,7 @@ jobs: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - name: Deploy to GitHub Pages + if: env.has_release_label == 'true' run: | git checkout gh-pages git pull origin main --rebase --autostash