Skip to content

Commit

Permalink
Update dependbot-auto-approve.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr-ius authored Apr 22, 2024
1 parent 69342d6 commit b97b31e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/dependbot-auto-approve.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
name: Dependabot auto-approve
name: Dependency auto-merge
on: pull_request

permissions:
pull-requests: write

jobs:
dependabot:
dependency:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'pre-commit-ci[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Enable auto-merge for Dependabot PRs
if: contains(steps.metadata.outputs.dependency-names, 'my-dependency') && steps.metadata.outputs.update-type == 'version-update:semver-patch'
# if: contains(steps.metadata.outputs.dependency-names, 'my-dependency') && steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
Expand Down

0 comments on commit b97b31e

Please sign in to comment.