mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-06-16 08:26:52 +08:00
fix: enforce policy.review.required gate in applyPublish
applyPublish was forcing review='approved' for any state that wasn't 'changes-requested', bypassing policy.review.required entirely. Add a guard that throws before buildIssueStateFromAction when review approval is required but not yet granted. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
273b82c8ba
commit
573ebe0918
@ -183,6 +183,10 @@ function applyPublish(repo, issueNumber, options = {}, context = {}) {
|
|||||||
throw new Error(`Issue #${issueNumber} is not ready to publish: ${validation.validations.map(entry => `${entry.check}=${entry.ok}`).join(', ')}`);
|
throw new Error(`Issue #${issueNumber} is not ready to publish: ${validation.validations.map(entry => `${entry.check}=${entry.ok}`).join(', ')}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (policy.review && policy.review.required && state.review !== 'approved') {
|
||||||
|
throw new Error(`Issue #${issueNumber} cannot be published: review approval required (current: ${state.review})`);
|
||||||
|
}
|
||||||
|
|
||||||
const nextState = buildIssueStateFromAction(issue, state, 'publish', {
|
const nextState = buildIssueStateFromAction(issue, state, 'publish', {
|
||||||
status: 'published',
|
status: 'published',
|
||||||
validation: 'passed',
|
validation: 'passed',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user