Skip to content

Commit 287865e

Browse files
committed
Set review-workflow commit status for non-docs PRs in ci-build.yml
Non-docs PRs were being blocked by branch protection because nothing was flipping the review-workflow status to success. stage-progression.yml handles it for docs PRs, but ci-build.yml needs to handle the non-docs path or those PRs can't merge.
1 parent 151d474 commit 287865e

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/ci-build.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
permissions:
88
contents: read
99
pull-requests: write
10+
statuses: write
1011

1112
jobs:
1213
build:
@@ -35,8 +36,21 @@ jobs:
3536
const touchesDocs = files.some(f => f.filename.startsWith('docs/'));
3637
if (touchesDocs) return; // docs PRs are handled by stage-progression.yml
3738
39+
// Flip the review-workflow commit status to success so branch
40+
// protection allows merge. This is the non-docs counterpart to
41+
// stage-progression.yml's status-setting for docs PRs.
42+
const headSha = context.payload.pull_request.head.sha;
43+
await github.rest.repos.createCommitStatus({
44+
owner: context.repo.owner,
45+
repo: context.repo.repo,
46+
sha: headSha,
47+
state: 'success',
48+
context: 'review-workflow',
49+
description: 'No doc changes — admin may merge',
50+
});
51+
3852
const marker = '<!-- ci-admin-merge-bot-comment -->';
39-
const sha = context.payload.pull_request.head.sha.substring(0, 7);
53+
const sha = headSha.substring(0, 7);
4054
const body = `${marker}\n\n✅ **CI build passed** for commit \`${sha}\`\n\nThis PR does not touch documentation content under \`docs/\`, so no multi-stage review is required.\n\n@usace-rmc/docs-admin may merge.`;
4155
const comments = await github.rest.issues.listComments({ owner: context.repo.owner, repo: context.repo.repo, issue_number: prNumber });
4256
const existing = comments.data.find(c => c.user.type === 'Bot' && c.body.includes(marker));

0 commit comments

Comments
 (0)