cucumber / cucumber/common

Cancel in-progress GitHub Actions runs when PRs are updated

Open
#2,269 0 comments 0 reactions 0 assignees View on GitHub
:zap: enhancement
Dominant language
No language data
Stars
3.4k
Forks
679
PR merge metrics
No merged PRs in 30d

Description

### 🤔 What's the problem you're trying to solve?

We are currently using GitHub-hosted runners, which gives us 20 instances. This effectively means that in the whole cucumber organization we can have at most 20 actions running concurrently. This should be sufficient for normal use.

However, when the main branch is updated, Renovate will rebase all open PRs. When the main branch is updated rapidly due to merging a sequence of PRs or a large number or renovate PRs, this creates a cascade of actions drowning out CI for the whole organization.

### ✨ What's your proposed solution?

By canceling in-progress GitHub Actions we can limit this. See examples in GitHub documentation [here](https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency#example-using-a-fallback-value) and [here](https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow). [Applied example from the JUnit Team](https://github.com/junit-team/junit-framework/pull/4841).

### ⛏ Have you considered any alternatives or workarounds?

We can limit language specific actions to changes in language specific folders. But we've applied that (almost) everywhere already.

### 📚 Any additional context?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.