actions
actions copied to clipboard
Cancel in-progress jobs of the same workflow, in PRs
For checks:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
For *down we currently have:
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
and we want something like:
concurrency:
group: pkgdown-${{ github.event.pull_request.number }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
(untested)
It is a bit more difficult, because there are no unique workflow ids, but nevertheless it is in #512.
But not in v2 yet.
In general it works great, with one serious glitch. An auto-cancelled workflow will be a failure, and you also get a notification about it. Which will be very annoying for PRs with lots of commits. Hopefully they will improve it: https://github.com/github/feedback/discussions/8336
Until they do, I'll revert that commit.
I am going to close this, because GitHub does not seem too eager to fix the notification issue. I am watching the corresponding community thread, so if they do fix it, we can come back to it.