Skip to content

Commit

Permalink
ci: enhance AutoMerge workflow for streamlined approvals
Browse files Browse the repository at this point in the history
- Add `contents: write` permission to the workflow
- Change `github-token` to `${{ github.token }}`
- Replace `Auto_Merge_PR` job with steps for checking out the repository and merging PRs using GitHub CLI

Signed-off-by: 陳鈞 <[email protected]>
  • Loading branch information
jim60105 committed Oct 20, 2024
1 parent 46e3b1f commit 6022e07
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions .github/workflows/AutoMerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ permissions:
# Permission to trigger the minify workflow
actions: write
pull-requests: write
contents: write

jobs:
Auto_Approve:
Expand All @@ -18,25 +19,14 @@ jobs:
- name: Auto approve
uses: hmarr/auto-approve-action@v4
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
github-token: "${{ github.token }}"

Auto_Merge_PR:
name: Auto Merge PR
runs-on: ubuntu-latest
needs: "Auto_Approve"
steps:
- name: Git Auto Merge
uses: plm9606/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
merge-method: merge
reviewers-number: 0
label-name: "automerge"
- uses: actions/checkout@v4

- name: Remove label
if: ${{ success() }}
uses: buildsville/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
label: "automerge"
type: remove
- name: Git Auto Merge
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr merge --merge \
--auto
shell: bash

0 comments on commit 6022e07

Please sign in to comment.