Skip to content

Concurrency group should include label name to prevent cross-label cancellation #23020

@deyaaeldeen

Description

@deyaaeldeen

Summary

When multiple labels are added to a PR simultaneously (e.g., via gh pr edit --add-label "a,b,c"), GitHub fires separate labeled events for each. Each event triggers all workflows that match pull_request_target: [labeled].

The compiled concurrency group is:

concurrency:
  group: "gh-aw-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}"
  cancel-in-progress: true

Since the group doesn't include the label name, all runs of the same workflow for the same PR share a group. With cancel-in-progress: true, the last run cancels all previous ones. If the surviving run was triggered by a different label than the workflow expects (e.g., Sentinel's surviving run was triggered by performance-review-needed instead of security-review-needed), the if: condition on pre_activation evaluates to false and the entire workflow is skipped.

Expected behavior

Include the label name (or label ID) in the concurrency group:

concurrency:
  group: "gh-aw-${{ github.workflow }}-${{ github.event.pull_request.number }}-${{ github.event.label.name }}"
  cancel-in-progress: true

This way runs triggered by different labels don't cancel each other.

Reproduction

  1. Create multiple gh-aw workflows, each filtering on a different label
  2. Add all labels to a PR at once: gh pr edit --add-label "label-a,label-b,label-c"
  3. Observe that only one workflow actually runs; others are cancelled or skipped

Environment

  • gh-aw v0.64.0

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions