PR path-labeler can remove labels added by concurrent workflows
Describe the Issue
Two workflows can update a pull request's labels at the same time:
GitHub - PR Contribution Guidelinesaddsdeprioritizedwhen a contribution-guideline check fails.GitHub - Label PRsindependently calculates path-based labels withsync-labels: true.The path-labeler action reads the existing labels and later replaces the complete label set. A label added by another workflow between those operations can be omitted from the replacement set.
This occurred on pull request #70509. The contribution-guidelines workflow added
deprioritizedafter detecting a commit made through the GitHub web editor. One second later, the concurrently running path-labeler workflow removeddeprioritizedwhile addingscope: curriculum. The failed guideline condition remained unresolved when the label disappeared.
Affected Pages
- https://github.com/freeCodeCamp/freeCodeCamp/blob/ff001b767cc6a0d2e0ff04c0598c36451b035edc/.github/workflows/github-pr-guidelines.yml
- https://github.com/freeCodeCamp/freeCodeCamp/blob/ff001b767cc6a0d2e0ff04c0598c36451b035edc/.github/workflows/github-labeler.yaml
- https://github.com/freeCodeCamp/freeCodeCamp/pull/70509
- https://github.com/freeCodeCamp/freeCodeCamp/actions/runs/36669688239
- https://github.com/freeCodeCamp/freeCodeCamp/actions/runs/36669688257
Expected behavior
Labels added by contribution-guideline checks should remain on a pull request until the corresponding condition is resolved. Path-based label updates should not remove labels added concurrently by another workflow.
Source: freeCodeCamp/freeCodeCamp