Skip to content

Update ci.yml

Update ci.yml #102

Workflow file for this run

# This is a single-maintainer project but I want to require reviews before
# merge, which means that I need a bot to review my own work.
name: Automatic pull request approvals
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- ready_for_review
check_suite:
types:
- completed
jobs:
auto-approve:
runs-on: ubuntu-latest
if: >
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.draft == false && (
github.event.action == 'opened' ||
github.event.action == 'reopened' ||
github.event.action == 'synchronize'
) && (
github.actor == 'jaqx0r'
)
permissions:
# wait on check
checks: read
# create review
pull-requests: write
steps:
- uses: lewagon/[email protected]
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: test
repo-token: ${{ github.token }}
wait-interval: 60
- uses: "actions/github-script@v6"
with:
github-token: ${{ github.token }}
script: |
await github.rest.pulls.createReview({
event: "APPROVE",
owner: context.repo.owner,
pull_number: context.payload.pull_request.number,
repo: context.repo.repo,
})