@@ -9,22 +9,36 @@ permissions:
99
1010jobs :
1111 dependabot :
12+ name : Approve & auto-merge Dependabot PRs
1213 runs-on : ubuntu-latest
14+
15+ # Only run for PRs opened by Dependabot
1316 if : github.event.pull_request.user.login == 'dependabot[bot]'
17+
1418 steps :
19+ # 1) Fetch Dependabot metadata (pinned SHA + tag comment for humans/renovators)
1520 - name : Dependabot metadata
1621 id : metadata
17- uses : dependabot/fetch-metadata@21025c7d3b7c1eb5122b2f4f30b18d6c8b8c52df # v2.5.0
22+ uses : dependabot/fetch-metadata@21025c7d3b7c1eb5122b2f4f30b18d6c8b8c52df
1823 with :
19- github-token : " ${{ secrets.GITHUB_TOKEN }}"
24+ github-token : ${{ secrets.GITHUB_TOKEN }}
25+
26+ # 2) (Optional) Log what’s being updated for troubleshooting
27+ - name : Summarize update
28+ run : |
29+ echo "Dependencies: ${{ steps.metadata.outputs.dependency-names }}"
30+ echo "Update type: ${{ steps.metadata.outputs.update-type }}"
2031
21- - name : Approve PR
32+ # 3) Approve the PR (required if code owner reviews are enforced)
33+ - name : Approve Dependabot PR
2234 run : gh pr review --approve "$PR_URL"
2335 env :
2436 PR_URL : ${{ github.event.pull_request.html_url }}
2537 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2638
27- - name : Enable auto-merge
39+ # 4) Enable auto-merge for safe updates (patch + minor).
40+ # Adjust the condition if you want patch-only or include majors.
41+ - name : Enable auto-merge (patch/minor)
2842 if : |
2943 steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
3044 steps.metadata.outputs.update-type == 'version-update:semver-minor'
0 commit comments