Skip to content

3D engine that AI agents drive

Cancel superseded metadata runs for the same pull request (#2172)

Nguyen Xuan An41efbb295b03
diff --git a/.github/workflows/pr-metadata.yml b/.github/workflows/pr-metadata.yml
index fa2976d4..c23431ea 100644
--- a/.github/workflows/pr-metadata.yml
+++ b/.github/workflows/pr-metadata.yml
@@ -24,8 +24,10 @@ permissions:
concurrency:
# One queue per pull request, so a run for one pull request never replaces the pending run of another.
- group: pr-metadata-${{ github.event.pull_request.number || 'sweep' }}
- cancel-in-progress: false
+ # A reopen run resets the close timer, so it gets its own group and a later run never cancels it.
+ group: pr-metadata-${{ github.event.pull_request.number || 'sweep' }}${{ github.event.action == 'reopened' && '-reopen' || '' }}
+ # A newer run for the same pull request reads the same current state, so it replaces the older one. The sweep is never cut off.
+ cancel-in-progress: ${{ github.event_name == 'pull_request_target' }}
jobs:
check:
diff --git a/.github/workflows/sync-pr-metadata.yml b/.github/workflows/sync-pr-metadata.yml
index 8ad50b16..9ec9a3d6 100644
--- a/.github/workflows/sync-pr-metadata.yml
+++ b/.github/workflows/sync-pr-metadata.yml
@@ -16,7 +16,8 @@ permissions:
concurrency:
group: sync-pr-metadata-${{ github.event.pull_request.number || github.event.issue.number }}
- cancel-in-progress: false
+ # A newer run for the same pull request reads the same current state, so it replaces the older one.
+ cancel-in-progress: ${{ github.event_name == 'pull_request_target' }}
jobs:
sync: