Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: let workflow not trigger on labels #58

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}