Skip to content

Commit 7deda4e

Browse files
ksroda-saclaude
andauthored
ci: auto-approve major Dependabot updates (#275)
* ci: auto-approve major Dependabot updates Remove the semver-patch/minor guards so the bot approves and enables auto-merge for all Dependabot PRs, including major version bumps. With 2 required reviewers, the bot approval still leaves a human review gate before auto-merge completes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci: drop now-unused Dependabot metadata step The fetch-metadata step only existed to gate on update-type; with the semver guards removed, nothing references it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ci: also gate auto-merge on the event actor pull_request.user.login is the PR author and stays dependabot[bot] for the PR's lifetime, so a human pushing commits to a Dependabot branch would otherwise trigger an auto-approval of their own changes. Require github.actor to be dependabot[bot] as well. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent db53d9b commit 7deda4e

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

.github/workflows/dependabot-auto-merge.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,17 @@ permissions:
99
jobs:
1010
auto-merge:
1111
runs-on: ubuntu-latest
12-
if: github.event.pull_request.user.login == 'dependabot[bot]'
12+
if: >-
13+
github.event.pull_request.user.login == 'dependabot[bot]' &&
14+
github.actor == 'dependabot[bot]'
1315
steps:
14-
- name: Fetch Dependabot metadata
15-
id: metadata
16-
uses: dependabot/fetch-metadata@v3
17-
with:
18-
github-token: ${{ secrets.GITHUB_TOKEN }}
1916
- name: Approve PR
20-
# Auto-merge patch + minor updates across all samples (RN iOS is now
21-
# covered by test-ios.yml's `pod install` + `xcodebuild build`).
22-
if: |
23-
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
24-
steps.metadata.outputs.update-type == 'version-update:semver-minor'
17+
# Auto-approve all updates (patch/minor/major) across all samples.
2518
run: gh pr review --approve "$PR_URL"
2619
env:
2720
PR_URL: ${{ github.event.pull_request.html_url }}
2821
GH_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_DEVOPS_2_PAT1 }}
2922
- name: Enable auto-merge
30-
if: |
31-
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
32-
steps.metadata.outputs.update-type == 'version-update:semver-minor'
3323
run: gh pr merge --auto --squash "$PR_URL"
3424
env:
3525
PR_URL: ${{ github.event.pull_request.html_url }}

0 commit comments

Comments
 (0)