Skip to content

Commit

Permalink
Create auto-merge-dependabot.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
slippersheepig authored Jul 31, 2024
1 parent ca08558 commit 9825d89
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/auto-merge-dependabot.yml
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

0 comments on commit 9825d89

Please sign in to comment.