BUILD-4175 Fix permission issue when canceling the update coverage action (#4081)

* Add missing permission to cancel the action
* Enable manual testing
This commit is contained in:
Mate Molnar 2024-07-19 11:00:29 +02:00 committed by GitHub
parent 140e595134
commit 96a10a4174
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,15 +2,16 @@ name: Update rule coverage
on:
schedule:
- cron: '17 2 * * *'
workflow_dispatch:
workflow_dispatch: # When manually triggered from a non-default branch, the results will not be pushed
jobs:
update_coverage:
runs-on: ubuntu-latest
permissions:
id-token: write
id-token: write # required by SonarSource/vault-action-wrapper
contents: write
checks: read
checks: read # required by fountainhead/action-wait-for-check
actions: write # required by andymckay/cancel-action
env:
TMP_BRANCH: temporary/coverage_update
@ -86,7 +87,8 @@ jobs:
- name: 'Push the updated coverage to master'
if: |
steps.gen-coverage.outputs.new_coverage == 'true' &&
steps.wait-for-build.outputs.conclusion == 'success'
steps.wait-for-build.outputs.conclusion == 'success' &&
(github.event_name != 'workflow_dispatch' || github.ref_name == ${{ github.event.repository.default_branch }})
working-directory: 'rspec'
run: |
git checkout master