-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,41 @@ | ||
# see https://gist.github.com/xt0rted/46475099dc0a70ba63e16e3177407872 | ||
|
||
name: Dependabot auto-merge | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- master | ||
|
||
permissions: | ||
issues: write | ||
contents: write | ||
pull-requests: write | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
auto-merge: | ||
runs-on: ubuntu-latest | ||
|
||
if: github.actor == 'dependabot[bot]' | ||
|
||
steps: | ||
- name: Create token | ||
id: create_token | ||
uses: tibdex/github-app-token@v2 | ||
with: | ||
app_id: ${{ secrets.BIG_MERGER_APP_ID }} | ||
private_key: ${{ secrets.BIG_MERGER_PRIVATE_KEY }} | ||
|
||
- name: Dependabot metadata | ||
id: dependabot-metadata | ||
uses: dependabot/fetch-metadata@v1 | ||
with: | ||
github-token: '${{ secrets.GITHUB_TOKEN }}' | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: Authenticate cli | ||
run: echo "${{ steps.create_token.outputs.token }}" | gh auth login --with-token | ||
|
||
- name: Enable auto-merge for Dependabot PRs | ||
if: contains(fromJSON('["version-update:semver-patch", "version-update:semver-minor"]'), steps.dependabot-metadata.outputs.update-type) | ||
run: gh pr merge --auto --squash "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |