Skip to content

Trigger end-to-end tests on external PR approval #17

Trigger end-to-end tests on external PR approval

Trigger end-to-end tests on external PR approval #17

name: Trigger end-to-end tests on external PR approval
on:
pull_request_review:
types: [submitted]
concurrency:
group: ${{ github.event_name }}-${{ github.ref }}
jobs:
test:
name: Trigger end-to-end tests
# If reviewed by a repo(/org) owner
if: |
github.event.pull_request.author_association != 'MEMBER'
&& github.event.review.author_association == 'MEMBER'
&& github.event.review.state == 'approved'
runs-on: ubuntu-latest
steps:
- run: >
gh api
"repos/py-cov-action/python-coverage-comment-action/check-runs"
-X POST
-F name="End-to-end tests (external PR)"
-F head_sha="${HEAD_SHA}"
-F status="in_progress"
-F started_at="$(date -u +%FT%TZ)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}