Skip to content

Commit

Permalink
ci: add org member check
Browse files Browse the repository at this point in the history
  • Loading branch information
scotthart committed Jul 19, 2024
1 parent 7603af8 commit 14f57e3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/test-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ concurrency:
cancel-in-progress: true

jobs:
# Require that the PR author be a member of the same organization as this
# repository in order to continue execution.
author-association-member:
name: Require Org Membership
runs-on: ubuntu-latest
steps:
- name: Check Membership
if: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.author_association != 'MEMBER' }}
run: |
echo "Event not triggered by organization member."
exit 1
pre-flight:
# For external contributors, run the build in the `external` environment.
# This requires manual approval from a contributor. It also saves the
Expand All @@ -43,6 +55,7 @@ jobs:
'external'
}}
name: Require Approval for External PRs
needs: [author-association-member]
runs-on: ubuntu-latest
outputs:
checkout-sha: ${{ steps.save-pull-request.outputs.sha }}
Expand Down

0 comments on commit 14f57e3

Please sign in to comment.