Skip to content

Commit f8f6740

Browse files
authored
ci(dependabot-merge): replace non-functioning merge action (#8306)
Refs ahmadnassri/action-dependabot-auto-merge#166
1 parent ab36a82 commit f8f6740

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

.github/workflows/dependabot-merge.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,28 @@ jobs:
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 }}

0 commit comments

Comments
 (0)