Skip to content

Commit

Permalink
#24 Auto approve imgbot
Browse files Browse the repository at this point in the history
  • Loading branch information
oakbrad committed Jun 2, 2024
1 parent 454fec2 commit 5bdf193
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/auto-approve-imgbot.yml
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

0 comments on commit 5bdf193

Please sign in to comment.