Allow moderated secrets usage on PRs from forks #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Receive pull request | |
on: | |
pull_request: | |
branches: [ main ] | |
env: | |
label: "safe to test" | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Ensure first-party branch or valid label | |
if: > | |
github.repository != github.event.pull_request.head.repo.full_name && | |
! contains(github.event.pull_request.labels.*.name, env.label) | |
run: | | |
echo "Will not run \`pytest\` workflow for branch in fork without label \`${{ env.label }}\`." >>$GITHUB_STEP_SUMMARY | |
exit 1 |