Skip to content

Commit 8f0d415

Browse files
committed
Enforce the intake gate from merge; keep PR_GATE_ENFORCE=false as a kill switch
No-Verification-Needed: workflow config only Signed-off-by: Max Isbey <224885523+maxisbey@users.noreply.github.com>
1 parent 8a66b3e commit 8f0d415

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎.github/scripts/pr_intake_gate.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
// the label, or adding `bypass-issue-check` overrides it, and the override
1111
// sticks.
1212
//
13-
// Everything that writes goes through mutate(), so with ENFORCE unset the run
14-
// only logs what it would have done.
13+
// Everything that writes goes through mutate(); when the workflow passes
14+
// ENFORCE=false (its kill switch) the run only logs what it would have done.
1515
'use strict';
1616

1717
const LABEL = 'missing-issue-link'; // marks PRs the gate has closed

‎.github/scripts/pr_intake_gate.test.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ for (const s of scenarios) {
228228
});
229229
}
230230

231-
test('dry run (PR_GATE_ENFORCE unset) reaches the same verdicts but writes nothing', async () => {
231+
test('kill switch (ENFORCE=false) reaches the same verdicts but writes nothing', async () => {
232232
for (const s of scenarios) {
233233
const world = makeWorld(s);
234234
await run(world, s.event, { enforce: false });

‎.github/workflows/require-linked-issue.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
# `bypass-issue-check` overrides.
1010
#
1111
# Operating it:
12-
# - Dry-run until the repository variable PR_GATE_ENFORCE is set to "true".
12+
# - Live by default. To pause it without a revert, set the repository
13+
# variable PR_GATE_ENFORCE to "false": runs then only log their verdicts.
1314
# - PRs below the number in the job `if:` predate the gate and are ignored
1415
# unless evaluated by hand: `gh workflow run require-linked-issue.yml -f pr_number=N`.
1516
#
@@ -67,7 +68,7 @@ jobs:
6768
issues: write # read linked issues; label and comment on the PR
6869
pull-requests: write # close and reopen the PR
6970
env:
70-
ENFORCE: ${{ vars.PR_GATE_ENFORCE == 'true' && 'true' || 'false' }}
71+
ENFORCE: ${{ vars.PR_GATE_ENFORCE != 'false' && 'true' || 'false' }} # kill switch: set the variable to "false" to go log-only
7172
PR_NUMBER_INPUT: ${{ inputs.pr_number }}
7273
steps:
7374
- name: Check out the gate script (default branch)

0 commit comments

Comments
 (0)