actions icon indicating copy to clipboard operation
actions copied to clipboard

Cancel in-progress jobs of the same workflow, in PRs

Open gaborcsardi opened this issue 3 years ago • 1 comments

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)

gaborcsardi avatar Feb 22 '22 10:02 gaborcsardi

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.

gaborcsardi avatar Feb 25 '22 14:02 gaborcsardi

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.

gaborcsardi avatar May 08 '24 13:05 gaborcsardi