Adding Concurrency Cancellation to GitHub Actions Workflows to Save CI Minutes
Adding Concurrency Cancellation to GitHub Actions Workflows to Save CI Minutes TL;DR: I added the concurrency feature with cancel-in-progress to the CI and E2E GitHub Actions workflows of the lavanderia-crm repo. This prevents overlapping runs on the same branch/PR, cutting down wasted minutes and keeping the pipeline fast. The Problem Our CI pipeline ( .github/workflows/ci.yml ) and the nightly…
The article discusses the implementation of concurrency cancellation in GitHub Actions workflows for the lavanderia-crm repository. The author faced issues with multiple parallel jobs fighting for resources and consuming unnecessary CI minutes due to overlapping runs on the same branch or pull request. The native GitHub feature, concurrency keyword with cancel-in-progress set to true, was introduced to address this issue.
By grouping workflow runs by a unique key, such as the branch name for PR events and the branch name for direct pushes, the author ensured that each branch had its own concurrency group. This prevented overlapping runs and saved CI minutes, keeping the pipeline fast. The author successfully updated the .github/workflows/ci.yml and .github/workflows/e2e-production.yml workflows to include the concurrency and cancel-in-progress settings, resulting in more efficient CI operations.
Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.