Skip to content

[ImgBot] Optimize images #6

[ImgBot] Optimize images

[ImgBot] Optimize images #6

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 imgbot
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 imgbot
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:
- id: automerge
name: Auto merge
# Custom action for auto merging already available on marketplace
uses: "pascalgn/automerge-action@v0.16.3"
# Perform the auto merge action only when the PR is raised by imgbot
if: github.actor == 'imgbot[bot]' || github.actor == 'ImgBot[bot]'
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
MERGE_METHOD: rebase
UPDATE_LABELS: ""
MERGE_LABELS: "!x"
MERGE_ERROR_FAIL: "true"