Skip to content

Commit

Permalink
fix: let workflow not trigger on labels (#58)
Browse files Browse the repository at this point in the history
* fix: let workflow not trigger on labels

* set label before the send message job
  • Loading branch information
JTaeuber authored Sep 18, 2024
1 parent ef731a3 commit 2c66e80
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/check-for-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ jobs:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'new release') }}
run: |
if [ "${{ env.app_version_change }}" == "version changed" ]; then
gh pr edit ${{ github.event.pull_request.number }} --add-label "needs approval"
echo "Version changed, exiting..."
exit 1
else
echo "No appVersion changes detected."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Remove approval label
run: |
Expand All @@ -54,7 +57,7 @@ jobs:
name: Post Message To Warn Of New Release
runs-on: ubuntu-latest
needs: check_for_release
if: ${{ failure() && !contains(github.event.pull_request.labels.*.name, 'needs approval') }}
if: ${{ failure() && !contains(github.event.pull_request.labels.*.name, 'needs approval') && github.event.action != 'labeled' && github.event.action != 'unlabeled' }}
permissions:
contents: write
pull-requests: write
Expand All @@ -77,9 +80,3 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body: "⚠️ Warning: Merging this PR will result in a new release because the `appVersion` in Chart.yaml has changed to `${{ env.appversion }}`. Please confirm this by adding the `new release` label before merging."

- name: Set a label on the pull request
run: |
gh pr edit ${{ github.event.pull_request.number }} --add-label "needs approval"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 2c66e80

Please sign in to comment.