Skip to content

Commit

Permalink
Merge pull request #479 from xt0rted/xt0rted-patch-1
Browse files Browse the repository at this point in the history
Create dependabot-auto-merge.yml
  • Loading branch information
xt0rted authored Feb 2, 2022
2 parents 5bcb514 + 8e6303c commit 6280802
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# https://gist.github.com/xt0rted/46475099dc0a70ba63e16e3177407872
name: Dependabot auto-merge

on: pull_request_target

permissions:
contents: read
pull-requests: read

jobs:
dependabot:
runs-on: ubuntu-latest

if: ${{ github.actor == 'dependabot[bot]' }}

steps:
- name: Generate token
id: generate_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.DEPENDAMERGE_APP_ID }}
private_key: ${{ secrets.DEPENDAMERGE_PRIVATE_KEY }}

- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

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

- name: Enable auto-merge for Dependabot PRs
if: steps.dependabot_metadata.outputs.dependency-type == 'direct:development' && (steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor' || steps.dependabot-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 }}

0 comments on commit 6280802

Please sign in to comment.