-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
ca08558
commit 9825d89
Showing
1 changed file
with
34 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,34 @@ | ||
name: Auto Merge Dependabot PRs | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
merge: | ||
if: github.actor == 'dependabot[bot]' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install gh | ||
run: | | ||
wget https://github.com/cli/cli/releases/download/v2.0.0/gh_2.0.0_linux_amd64.tar.gz | ||
tar -xvf gh_2.0.0_linux_amd64.tar.gz | ||
sudo mv gh_2.0.0_linux_amd64/bin/gh /usr/local/bin | ||
- name: Configure Git | ||
run: | | ||
git config --global user.email "actions@github.com" | ||
git config --global user.name "GitHub Actions" | ||
- name: Merge PR | ||
run: | | ||
# 获取 PR 号码 | ||
PR_NUMBER=$(jq -r .pull_request.number < "$GITHUB_EVENT_PATH") | ||
# 合并 PR | ||
gh pr merge $PR_NUMBER --auto --merge --delete-branch |