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
28 changes: 19 additions & 9 deletions .github/scripts/__tests__/agents-guard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,25 @@ test('blocks renames of protected workflows that are not allowlisted', () => {
});

test('allows removal of allowlisted workflow paths', () => {
const result = evaluateGuard({
files: [{
filename: '.github/workflows/agents-75-keepalive-on-gate.yml',
status: 'removed',
}],
});

assert.equal(result.blocked, false);
assert.equal(result.fatalViolations.length, 0);
const allowlistedPaths = [
'.github/workflows/agents-75-keepalive-on-gate.yml',
'.github/workflows/agents-autofix-loop.yml',
'.github/workflows/agents-bot-comment-handler.yml',
'.github/workflows/agents-keepalive-loop.yml',
'.github/workflows/agents-verify-to-issue-v2.yml',
];

for (const filename of allowlistedPaths) {
const result = evaluateGuard({
files: [{
filename,
status: 'removed',
}],
});

assert.equal(result.blocked, false, filename);
assert.equal(result.fatalViolations.length, 0, filename);
}
});

test('does not allow label-only bypass without codeowner approval', () => {
Expand Down
6 changes: 6 additions & 0 deletions .github/scripts/agents-guard.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ const ALLOW_REMOVED_PATHS = new Set(
// v1 verify-to-issue workflow deprecated; v2 is the active version.
// Archived to archives/deprecated-workflows/
'.github/workflows/agents-verify-to-issue.yml',
// Wave 0 cleanup removes deprecated consumer-template workflows past the
// 2026-02-15 deprecation deadline so sync PRs can delete stale copies.
'.github/workflows/agents-autofix-loop.yml',
'.github/workflows/agents-bot-comment-handler.yml',
'.github/workflows/agents-keepalive-loop.yml',
'.github/workflows/agents-verify-to-issue-v2.yml',
Comment on lines +37 to +40

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep active workflows out of removal allowlist

Adding these four paths to ALLOW_REMOVED_PATHS disables Health 45 protection for deleting or renaming them in the Workflows repo, because evaluateGuard treats allowlisted removals/renames as an immediate continue (no fatal violation, label, or CODEOWNER gate). Since these workflow files still exist under .github/workflows/, a PR can now remove critical automation like agents-autofix-loop.yml or agents-keepalive-loop.yml without the guard blocking it.

Useful? React with 👍 / 👎.

Comment on lines +35 to +40
// The verify-to-new-pr autopilot bridge was collapsed into the main workflow.
'.github/workflows/agents-verify-to-new-pr-autopilot.yml',
].map((entry) => entry.toLowerCase()),
Expand Down
6 changes: 6 additions & 0 deletions templates/consumer-repo/.github/scripts/agents-guard.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ const ALLOW_REMOVED_PATHS = new Set(
// v1 verify-to-issue workflow deprecated; v2 is the active version.
// Archived to archives/deprecated-workflows/
'.github/workflows/agents-verify-to-issue.yml',
// Wave 0 cleanup removes deprecated consumer-template workflows past the
// 2026-02-15 deprecation deadline so sync PRs can delete stale copies.
'.github/workflows/agents-autofix-loop.yml',
'.github/workflows/agents-bot-comment-handler.yml',
'.github/workflows/agents-keepalive-loop.yml',
'.github/workflows/agents-verify-to-issue-v2.yml',
// The verify-to-new-pr autopilot bridge was collapsed into the main workflow.
'.github/workflows/agents-verify-to-new-pr-autopilot.yml',
].map((entry) => entry.toLowerCase()),
Expand Down
Loading