Skip to content

Commit

Permalink
ci: automerge dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
Rei-x committed Jan 7, 2024
1 parent e654d93 commit 6512d41
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@ name: Dependabot auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write
contents: read
pull-requests: read

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_PRIVATE_KEY }}

- name: Authenticate cli
run: echo "${{ steps.generate_token.outputs.token }}" | gh auth login --with-token

- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.CI_GITHUB_TOKEN}}
PR_URL: ${{ github.event.pull_request.html_url }}

0 comments on commit 6512d41

Please sign in to comment.