Skip to content

[Sync] Update project files from source repository (c3e162d) - #390

Merged
mrz1836 merged 1 commit into
masterfrom
chore/sync-files-go-bitcoin-20261019-193742-c3e162d
Oct 19, 2026
Merged

mrz1836 merged 1 commit into
masterfrom
chore/sync-files-go-bitcoin-20261019-193742-c3e162d

Conversation

@mrz1836

@mrz1836 mrz1836 commented Oct 19, 2026

Copy link
Copy Markdown
Member

What Changed

  • Updated auto-merge-on-approval.yml so the base branch's rulesets must also require at least one approval and void it on a new push. A ruleset pull_request rule must set required_approving_review_count above 0, and a rule must set dismiss_stale_reviews_on_push or require_last_push_approval to true. This is now an always-enforced condition.
  • Added the check to both the evaluate job's script and the shell re-check step. Each computes a new value (approvalsVoidedOnPush / APPROVALS_VOIDED_ON_PUSH) from the rules it already reads for the base branch.
  • Added a new blocker action, skip-stale-approvals-kept, with the description "Skipped (base branch keeps approvals after new pushes, or requires none)". When it fires, the evaluate script emits a core.warning titled "Approvals survive new pushes on ".
  • Reworded the "could not read" blocker from "could not read the base branch required checks" to "could not read the base branch rules". The "requires no status checks" and new approval blockers are now evaluated independently once the rules are readable. The log output now also prints whether approvals are voided on push.
  • Updated the header comment in auto-merge-trigger.yml to say "both auto-merge workflows only arm when the base branch's rulesets dismiss stale approvals on push". It previously named only Dependabot Auto-merge and said it "only approves".
  • Modified the documentation file .github/docs/auto-merge-github-app.md (7 lines added, 7 removed). Its diff was trimmed, so no further details are described here.

Why It Was Necessary

  • Revoking auto-merge after a push depends on the PR-side trigger running, and whoever pushes controls that file. GitHub itself must therefore make an approval of older code worthless to an armed auto-merge.
  • Without this, someone who pushes to an armed PR and edits the PR-side trigger could merge unreviewed code.
  • The trigger-file comment previously described this protection for only one workflow. It now covers both.

Testing Performed

  • No test runs are shown in the diff. The change is to workflow logic, comments, and docs.
  • The same condition is implemented in both the JavaScript evaluate step and the jq/shell re-check step. Reviewers can compare the two for consistency.
  • Behavior can be confirmed by running the workflow against base branches with and without a qualifying ruleset. The expected result is skip-stale-approvals-kept when the ruleset is missing.

Impact / Risk

  • Behavior change: Auto-merge on approval now stays off for any base branch whose rulesets don't require an approval and dismiss it on push, so some repositories will stop auto-merging until their rulesets are updated.
  • Scope of detection: Only rulesets count. Classic branch protection review settings aren't readable with this token, so they are not treated as satisfying the requirement.
  • Fail-closed: If the rules can't be read, the workflow still blocks. Risk is low and the change tightens security. Operators will need to adjust ruleset settings to keep using auto-merge.

Copilot AI balanced review requested due to automatic review settings October 19, 2026 19:38
@mrz1836 mrz1836 self-assigned this Oct 19, 2026
@mrz1836 mrz1836 added automated-sync Automated sync PR, e.g. from a fork or external repo automerge Label to automatically merge pull requests that meet all required conditions chore Simple dependency updates or version bumps labels Oct 19, 2026
@github-actions github-actions Bot added update General updates size/M Medium change (51-200 lines) labels Oct 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Security-critical merge enforcement still needs pagination corrections and validation against live GitHub rulesets.

1 open issue
What changed in this PR

Tightens auto-merge safeguards so GitHub rulesets must require approval and prevent older approvals from authorizing new pushes.

Changes:

  • Enforces the approval requirement in evaluation and the final re-check.
  • Adds a blocker and diagnostic messages.
  • Updates setup documentation and trigger comments.
File Description
.github/​workflows/​auto-merge-trigger.yml Updates the comment to cover both workflows.
.github/​workflows/​auto-merge-on-approval.yml Adds ruleset approval checks and reporting.
.github/​docs/​auto-merge-github-app.md Documents requirements and troubleshooting.

Review effort: Balanced

Comment on lines +447 to +449
const reviewRules = rules.filter(r => r.type === 'pull_request').map(r => r.parameters || {});
const voided = reviewRules.some(p => (p.required_approving_review_count || 0) > 0) &&
reviewRules.some(p => p.dismiss_stale_reviews_on_push === true || p.require_last_push_approval === true);
@mrz1836
mrz1836 merged commit 6b97133 into master Oct 19, 2026
40 checks passed
@github-actions
github-actions Bot deleted the chore/sync-files-go-bitcoin-20261019-193742-c3e162d branch October 19, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-sync Automated sync PR, e.g. from a fork or external repo automerge Label to automatically merge pull requests that meet all required conditions chore Simple dependency updates or version bumps size/M Medium change (51-200 lines) update General updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants