Skip to content

Commit 528065e

Browse files
ksroda-saclaude
andcommitted
Address Copilot review: gate auto-merge on patch/minor only
- Use PR author check instead of github.actor for reliability - Add dependabot/fetch-metadata to gate on semver patch/minor - Use GH_TOKEN instead of GITHUB_TOKEN for gh CLI consistency Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b703a68 commit 528065e

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@ permissions:
99
jobs:
1010
auto-merge:
1111
runs-on: ubuntu-latest
12-
if: github.actor == 'dependabot[bot]'
12+
if: github.event.pull_request.user.login == 'dependabot[bot]'
1313
steps:
14+
- name: Fetch Dependabot metadata
15+
id: metadata
16+
uses: dependabot/fetch-metadata@v2
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
1419
- name: Approve PR
20+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
1521
run: gh pr review --approve "$PR_URL"
1622
env:
1723
PR_URL: ${{ github.event.pull_request.html_url }}
18-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1925
- name: Enable auto-merge
26+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
2027
run: gh pr merge --auto --squash "$PR_URL"
2128
env:
2229
PR_URL: ${{ github.event.pull_request.html_url }}
23-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)