ci(dependabot-merge): replace non-functioning merge action (#8306)

Refs https://github.com/ahmadnassri/action-dependabot-auto-merge/issues/166
This commit is contained in:
Vladimír Gorej
2022-11-24 11:38:01 +01:00
committed by GitHub
parent ab36a82b9f
commit f8f674004a

View File

@@ -9,9 +9,28 @@ jobs:
if: github.actor == 'dependabot[bot]' if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Merge me! # This first step will fail if there's no metadata and so the approval
uses: ahmadnassri/action-dependabot-auto-merge@v2 # will not occur.
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.1.1
with: with:
target: minor github-token: "${{ secrets.GITHUB_TOKEN }}"
github-token: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }} # Here the PR gets approved.
command: squash and merge - name: Approve a PR
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
# Finally, tell dependabot to merge the PR if all checks are successful
- name: Instruct dependabot to squash & merge
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
uses: mshick/add-pr-comment@v2
with:
repo-token: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
allow-repeats: true
message: |
@dependabot squash and merge
env:
GITHUB_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}