-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
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 approve and merge PRs by imgbot | ||
|
||
# Trigger the workflow on pull request | ||
on: | ||
pull_request | ||
|
||
jobs: | ||
autoapprove: | ||
name: Auto Approve a PR by imgbot # Name of the job | ||
runs-on: ubuntu-latest # Environment on which the job runs | ||
steps: | ||
- name: Auto approve | ||
uses: hmarr/auto-approve-action@v2.0.0 # Custom action for auto approval already available on marketplace | ||
# Perform the auto approve action only when the PR is raised by dependabot | ||
if: github.actor == 'imgbot[bot]' || github.actor == 'ImgBot[bot]' | ||
with: | ||
# Create a personal access token and store it under the Secrets section of the particular repository | ||
# with the key "ACTIONS_TOKEN" | ||
github-token: ${{ secrets.ACTIONS_TOKEN }} | ||
automerge: | ||
name: Auto merge after successful checks | ||
# By default, jobs run in parallel. To run the jobs sequentially, they keywords "needs" is needed. | ||
# Auto merge action can be done only when the PR is approved, hence this automerge needs autoapprove as a prerequisite | ||
needs: autoapprove | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Auto merge | ||
# Custom action for auto merging already available on marketplace | ||
uses: pascalgn/automerge-action@135f0bdb927d9807b5446f7ca9ecc2c51de03c4a | ||
# Perform the auto merge action only when the PR is raised by dependabot | ||
if: github.actor == 'imgbot[bot]' || github.actor == 'ImgBot[bot]' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} | ||
MERGE_METHOD: rebase |