diff --git a/.github/workflows/check-for-release.yaml b/.github/workflows/check-for-release.yaml index 3081f43..98117ee 100644 --- a/.github/workflows/check-for-release.yaml +++ b/.github/workflows/check-for-release.yaml @@ -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: | @@ -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 @@ -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 }}