11name : Dependabot - Auto Merge
2+ on : pull_request
23
3- on :
4- workflow_run :
5- types : [ completed ]
6- workflows : [ "Test Suite" ]
4+ permissions :
5+ contents : write
6+ pull-requests : write
77
88jobs :
9- merge-me :
10- name : " Merge me!"
9+ dependabot :
1110 runs-on : ubuntu-latest
11+ if : ${{ github.actor == 'dependabot[bot]' }}
1212 steps :
13- - # It is often a desired behavior to merge only when a workflow execution
14- # succeeds. This can be changed as needed.
15- if : ${{ github.event.workflow_run.conclusion == 'success' }}
16- name : Merge me!
17- uses : ridedott/merge-me-action@v2
13+ - name : Dependabot metadata
14+ id : metadata
15+ uses : dependabot/fetch-metadata@v1
1816 with :
19- # Depending on branch protection rules, a manually populated
20- # `GITHUB_TOKEN_WORKAROUND` secret with permissions to push to
21- # a protected branch must be used. This secret can have an arbitrary
22- # name, as an example, this repository uses `DOTTBOTT_TOKEN`.
23- #
24- # When using a custom token, it is recommended to leave the following
25- # comment for other developers to be aware of the reasoning behind it:
26- #
27- # This must be used as GitHub Actions token does not support pushing
28- # to protected branches.
29- GITHUB_TOKEN : ${{ secrets.ACCESS_TOKEN }}
17+ github-token : " ${{ secrets.GITHUB_TOKEN }}"
18+ - name : Enable auto-merge for Dependabot PRs
19+ if : ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
20+ run : gh pr merge --auto --merge "$PR_URL"
21+ env :
22+ PR_URL : ${{github.event.pull_request.html_url}}
23+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
0 commit comments