11name : Dependabot Auto-Merge
22
3- on : pull_request
3+ on :
4+ pull_request :
5+ types : [opened, synchronize, reopened, ready_for_review]
46
57permissions :
68 pull-requests : write
@@ -9,31 +11,31 @@ permissions:
911jobs :
1012 dependabot :
1113 runs-on : ubuntu-latest
12- if : github.actor == 'dependabot[bot]'
14+ if : github.event.pull_request.user.login == 'dependabot[bot]' && !github.event.pull_request.draft
1315 steps :
1416 - name : Fetch Dependabot metadata
1517 id : dependabot-metadata
16- uses : dependabot/fetch-metadata@v3
18+ uses : dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98
1719 with :
18- github-token : " ${{ secrets.GITHUB_TOKEN }}"
20+ github-token : " ${{ github.token }}"
21+
22+ - name : Mark major updates for manual review
23+ if : steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major'
24+ run : gh pr edit "$PR_URL" --add-label "major-update" || true
25+ env :
26+ PR_URL : ${{ github.event.pull_request.html_url }}
27+ GH_TOKEN : ${{ github.token }}
1928
2029 - name : Auto-Approve minor/patch updates
2130 if : steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor'
2231 run : gh pr review --approve "$PR_URL"
2332 env :
24- PR_URL : ${{github.event.pull_request.html_url}}
25- GH_TOKEN : ${{secrets.PAT_TOKEN }}
33+ PR_URL : ${{ github.event.pull_request.html_url }}
34+ GH_TOKEN : ${{ github.token }}
2635
2736 - name : Enable Auto-Merge (Squash) for minor/patch
2837 if : steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor'
2938 run : gh pr merge --auto --squash "$PR_URL"
3039 env :
31- PR_URL : ${{github.event.pull_request.html_url}}
32- GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
33-
34- - name : Label major updates for manual review
35- if : steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major'
36- run : gh pr edit "$PR_URL" --add-label "major-update"
37- env :
38- PR_URL : ${{github.event.pull_request.html_url}}
39- GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
40+ PR_URL : ${{ github.event.pull_request.html_url }}
41+ GH_TOKEN : ${{ github.token }}
0 commit comments