-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: enable auto-merge for Dependabot PRs
- Loading branch information
1 parent
cfdc22a
commit de4a8c9
Showing
1 changed file
with
36 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: deps-automerge | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
defaults: | ||
run: | ||
# NOTE: Default option does not include `-o pipefail` as documented | ||
# unless explicitly specifying the `bash` shell. | ||
# https://github.com/actions/runner/issues/353 | ||
shell: bash | ||
|
||
jobs: | ||
automerge: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 2 | ||
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && github.repository_owner == 'loozhengyuan' }} | ||
|
||
steps: | ||
- name: Fetch Dependabot metadata | ||
uses: dependabot/fetch-metadata@v2.2.0 | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: Enable auto-merge for Dependabot PRs | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
run: | | ||
gh pr merge --auto --squash --delete-branch "${PR_URL}" |