Skip to content

Commit 3126220

Browse files
fix(ci): use live PR title in feat-minor-bump-gate (#3240)
Closes #3240 - Move livePr API fetch before title check - Change pr.title to livePr.title for regex test - Single API call provides both live title and live labels - Title renames now take effect on re-run
1 parent ed06fc9 commit 3126220

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,21 @@ jobs:
7878
return;
7979
}
8080
81-
const title = pr.title || '';
81+
// Fetch live PR data from the API instead of using the frozen payload.
82+
// This ensures re-runs pick up title changes and labels added after the initial push.
83+
const { data: livePr } = await github.rest.pulls.get({
84+
owner: context.repo.owner,
85+
repo: context.repo.repo,
86+
pull_number: pr.number,
87+
});
88+
89+
const title = livePr.title || '';
8290
const isFeat = /^feat(\(.+\))?!?:\s/i.test(title);
8391
if (!isFeat) {
8492
core.info(`PR title is not feat:* (${title}); gate passed.`);
8593
return;
8694
}
8795
88-
// Fetch live labels from the API instead of using the frozen payload.
89-
// This ensures re-runs pick up labels added after the initial push.
90-
const { data: livePr } = await github.rest.pulls.get({
91-
owner: context.repo.owner,
92-
repo: context.repo.repo,
93-
pull_number: pr.number,
94-
});
9596
const labels = (livePr.labels || []).map(label => label.name);
9697
9798
if (labels.includes('approved-minor-bump')) {

0 commit comments

Comments
 (0)