Skip to content

Commit 29247c5

Browse files
authored
docs: auto-merge reusable header — real merge gating + denylist as defense-in-depth (#27)
Resolves audit **R5** (upstream source) and the **R14** reusable-header portion. Comment-only; corrects the false 'auto-merge waits for required status checks' claim (no required_status_checks are configured) and softens the OPA 'rejects PR-head references' over-claim to a defense-in-depth denylist. YAML parses; no denylist substrings in code lines (repo_hygiene OPA stays green).
1 parent d6a8c82 commit 29247c5

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

.github/workflows/reusable-auto-merge.yaml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: Reusable Auto-Merge
22

3-
# Enables GitHub auto-merge on pull requests authored by trusted bots once
4-
# all required status checks pass. Branch protection on `main` is what
5-
# defines the actual gate; this workflow only flips the auto-merge bit.
3+
# Enables GitHub auto-merge on pull requests authored by trusted bots. The
4+
# repo's branch-protection ruleset defines what GitHub waits on before
5+
# completing the merge; this workflow only flips the auto-merge bit. NOTE:
6+
# where a repo configures no required status checks (the current
7+
# NWarila/nwarila-platform posture), auto-merge completes once the review
8+
# requirements are met and does NOT wait for CI.
69
#
710
# Trusted authors:
811
# - renovate[bot]
@@ -26,14 +29,17 @@ name: Reusable Auto-Merge
2629
#
2730
# Why pull_request_target is safe here: authorization runs in a read-only job
2831
# first, and the write-token job is skipped unless the PR author is trusted.
29-
# The OPA policy also rejects checkout/PR-head references in this workflow and
30-
# in pull_request_target callers so future edits cannot quietly add PR-content
31-
# reads under the privileged token.
32+
# That authorize/skip split is the load-bearing safeguard. As defense-in-depth,
33+
# the OPA repo_hygiene policy also denies a denylist of known checkout/PR-head
34+
# reference patterns in this workflow and in pull_request_target callers; that
35+
# substring denylist is not an exhaustive guarantee, so it backstops rather than
36+
# replaces the read-only-authorization design above.
3237
#
33-
# Auto-merge waits for the repo's branch protection required checks to pass
34-
# before merging. If branch protection isn't configured, GitHub will not
35-
# allow auto-merge to be enabled at all; `gh pr merge --auto` will fail
36-
# loudly.
38+
# Auto-merge waits for whatever the repo's branch-protection ruleset requires
39+
# before merging. With no required status checks configured (current posture),
40+
# that is the review requirements only, so it does not wait for CI. If a repo
41+
# has no merge requirements at all, GitHub may refuse to enable auto-merge and
42+
# `gh pr merge --auto` fails loudly.
3743

3844
on:
3945
workflow_call:

0 commit comments

Comments
 (0)