Skip to content

Commit

Permalink
Update Dependabot automation
Browse files Browse the repository at this point in the history
Signed-off-by: Andrej Orsula <[email protected]>
  • Loading branch information
AndrejOrsula committed Mar 9, 2024
1 parent 3817fc7 commit e4f001e
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: Dependabot automation
on:
pull_request:
check_run:
types: [completed]
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
approve:
dependabot_automation:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}
steps:
Expand All @@ -18,23 +15,12 @@ jobs:
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve PR
- name: Approve the PR
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: gh pr review --approve "$PR_URL"

auto_merge:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'check_run' }}
steps:
- name: Fetch metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable PR auto-merge
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
- name: Enable auto-merge for the PR
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand Down

0 comments on commit e4f001e

Please sign in to comment.