Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
types: [opened, edited, synchronize, reopened]
merge_group:

# Keep only the newest request for each PR, including queue-description edits.
# Still validate every surviving event: skipping edits could mask a failed check.
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.event.merge_group.head_sha || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request_target' }}

permissions:
contents: read
pull-requests: read
Expand Down
9 changes: 9 additions & 0 deletions scripts/check-pr-title.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,12 @@ test("guards the repository setting that exposes the title to release automation
/Revalidate merge group release impact\n\s+if: github\.event_name == 'merge_group' && github\.event\.merge_group\.base_ref == format\('refs\/heads\/\{0\}', github\.event\.repository\.default_branch\)[\s\S]*MERGE_GROUP_BASE_REF:[\s\S]*MERGE_GROUP_HEAD_REF:[\s\S]*MERGE_GROUP_SHA:[\s\S]*run: node scripts\/check-pr-release-impact\.mjs/,
);
});

test("title requests coalesce per PR without skipping edit validation", () => {
const workflow = readFileSync(new URL("../.github/workflows/pr-title.yml", import.meta.url), "utf8");
assert.match(workflow, /types: \[opened, edited, synchronize, reopened\]/);
assert.match(workflow, /group: \$\{\{ github.workflow \}\}-\$\{\{ github.event_name \}\}-\$\{\{ github.event.pull_request.number \|\| github.event.merge_group.head_sha \|\| github.run_id \}\}/);
assert.match(workflow, /cancel-in-progress: \$\{\{ github.event_name == 'pull_request_target' \}\}/);
assert.doesNotMatch(workflow, /github.event.action != 'edited'|queue: max/);
assert.match(workflow, /github.event.pull_request.state == 'open'/);
});
Loading