-
Notifications
You must be signed in to change notification settings - Fork 613
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #471 from ruby/automerge-2nd
Rewrite auto-merge feature for dependabot
- Loading branch information
Showing
1 changed file
with
13 additions
and
29 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,42 +1,26 @@ | ||
# from https://github.com/gofiber/swagger/blob/main/.github/workflows/dependabot_automerge.yml | ||
name: Dependabot auto-merge | ||
on: | ||
pull_request | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
pull_request_target: | ||
|
||
jobs: | ||
wait_for_checks: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- name: Wait for check is finished | ||
uses: lewagon/[email protected] | ||
id: wait_for_checks | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
running-workflow-name: wait_for_checks | ||
check-regexp: test | ||
wait-interval: 10 | ||
env: | ||
REPO_TOKEN: ${{ secrets.MATZBOT_GITHUB_TOKEN }} | ||
dependabot: | ||
needs: [wait_for_checks] | ||
name: Dependabot auto-merge | ||
automerge: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- name: Dependabot metadata | ||
uses: dependabot/fetch-metadata@v1 | ||
id: metadata | ||
uses: dependabot/[email protected] | ||
- name: Wait for status checks | ||
uses: lewagon/[email protected] | ||
with: | ||
github-token: "${{ secrets.MATZBOT_GITHUB_TOKEN }}" | ||
- name: Enable auto-merge for Dependabot PRs | ||
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}} | ||
run: | | ||
gh pr merge --auto --merge "$PR_URL" | ||
repo-token: ${{ secrets.MATZBOT_GITHUB_TOKEN }} | ||
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
check-regexp: test* | ||
wait-interval: 30 | ||
- name: Auto-merge for Dependabot PRs | ||
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' || 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}} | ||
GITHUB_TOKEN: ${{secrets.MATZBOT_GITHUB_TOKEN}} | ||
GITHUB_TOKEN: ${{ secrets.MATZBOT_GITHUB_TOKEN }} |