Skip to content

CI: disable auto-cancel for master branch #42076

@fangchenli

Description

@fangchenli

#41962 enabled auto-cancel for GitHub Actions on both master and PRs. Ideally, we should only have this feature turned on for PRs.

Auto-cancel is achieved with the concurrency feature. It looks like this:

    concurrency:
      group: ${{ github.ref }}-xxx
      cancel-in-progress: true

The group attribute specifies a group name. So only one job can run for each group.

To disable it for master, we need to select the appropriate workflow/job variables from https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions for the group name so that it's different for each commit to the master but identical for each PR.

Metadata

Metadata

Assignees

Labels

CIContinuous Integration

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions