File tree Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Original file line number Diff line number Diff line change 99 if : github.actor == 'dependabot[bot]'
1010 runs-on : ubuntu-latest
1111 steps :
12- - name : Merge me!
13- uses : ahmadnassri/action-dependabot-auto-merge@v2
12+ # This first step will fail if there's no metadata and so the approval
13+ # will not occur.
14+ - name : Dependabot metadata
15+ id : dependabot-metadata
16+ uses :
dependabot/[email protected] 1417 with :
15- target : minor
16- github-token : ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
17- command : squash and merge
18+ github-token : " ${{ secrets.GITHUB_TOKEN }}"
19+ # Here the PR gets approved.
20+ - name : Approve a PR
21+ if : ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
22+ run : gh pr review --approve "$PR_URL"
23+ env :
24+ PR_URL : ${{ github.event.pull_request.html_url }}
25+ GITHUB_TOKEN : ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
26+ # Finally, tell dependabot to merge the PR if all checks are successful
27+ - name : Instruct dependabot to squash & merge
28+ if : ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
29+ uses : mshick/add-pr-comment@v2
30+ with :
31+ repo-token : ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
32+ allow-repeats : true
33+ message : |
34+ @dependabot squash and merge
35+ env :
36+ GITHUB_TOKEN : ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments