Skip to content

Commit 15921c7

Browse files
committed
Auto-merge ruby-builder-bot PRs
This PR is trying to drive the conversation from https://bugs.ruby-lang.org/issues/21804. I don't know that it's a good idea to auto-merge on a project so critical in the Ruby supply chain. For a foundational action that runs across thousands of CI pipelines, the blast radius of a bad merge is huge. Auto-merge might be reasonable, but only if it’s tightly scoped to low-risk, mechanically generated changes with strong guardrails. Pros: - Faster propagation of routine updates (e.g., version lists, metadata bumps) without maintainer latency. - Less maintainer toil on high-frequency bot PRs. - More consistent update cadence and fewer stale PRs. Cons: - Single-point-of-failure risk: a compromised bot or supply-chain attack can push a bad change quickly to many downstream users. - Reduced human review on changes that may have subtle security or correctness impacts. - Harder to detect abuse if tests can be manipulated or if the update surface grows over time.
1 parent 8a836ef commit 15921c7

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Auto-merge bot PRs
2+
on:
3+
workflow_run:
4+
workflows: ["Test this action"]
5+
types: [completed]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
auto-merge:
13+
runs-on: ubuntu-latest
14+
if: >
15+
github.event.workflow_run.conclusion == 'success' &&
16+
github.event.workflow_run.event == 'pull_request' &&
17+
github.event.workflow_run.actor.login == 'ruby-builder-bot' &&
18+
github.event.workflow_run.pull_requests[0].user.login == 'ruby-builder-bot' &&
19+
github.event.workflow_run.pull_requests[0].head.repo.full_name == 'ruby-builder-bot/setup-ruby'
20+
steps:
21+
- name: Merge PR
22+
env:
23+
GH_TOKEN: ${{ github.token }}
24+
run: |
25+
gh pr merge "${{ github.event.workflow_run.pull_requests[0].number }}" \
26+
--repo "${{ github.repository }}" \
27+
--squash \
28+
--delete-branch

0 commit comments

Comments
 (0)