Skip to content

Concurrency setting in GHA cancels runs across PRs #554

Open
@AnomalRoil

Description

@AnomalRoil

Currently our GHA are using pull_request_target instead of pull_request:

pull_request_target:

This has the unfortunate consequence that 2 different PRs can cancel each other jobs, because of how github.ref works:

Trigger event pull_request pull_request_target push
gihub.ref refs/pull/553/merge refs/heads/master refs/heads/test/pull_request_target
gihub.head_ref test/pull_request_target test/pull_request_target -
  • master: default branch
  • test/pull_request_target: topic branch name
  • 553: pull request number

I think the solution is to switch our concurrency groups from gihub.ref to gihub.head_ref:

concurrency:
group: ci-${{ github.ref }}-test

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions