GitHub Actions: Concurrency Control

My team uses GitHub Actions 18 in total jobs across about 12 workflows. When we get multiple pull requests we end up driving contention on the workflows and resources we use. I ran across concurrency control for the workflows.

To take advantage of concurrency control add this snippet to the bottom of your pull request workflow:

  group: audit-${{ github.event.pull_request.number || github.sha }}
  cancel-in-progress: true 

When you stack the commits you end up with this warning, and the prior job is stopped:

e2e-db2-with-bulkdata (11)
Canceling since a higher priority waiting request for 'integration-3014' exists

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.