Skip to content

Commit

Permalink
Add "receive" CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Nov 21, 2024
1 parent 618e13a commit 89fb99e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
# 05:00 UTC = 06:00 CET = 07:00 CEST
schedule:
- cron: "0 5 * * *"
workflow_run:
workflows: [ "Receive pull request" ]
types: [ completed ]
branches-ignore: [ main ]

# Cancel previous runs that have not completed
concurrency:
Expand All @@ -23,6 +27,10 @@ env:

jobs:
pytest:
if: >
github.event_name != 'workflow_run' ||
github.event.workflow_run.conclusion == 'success'
strategy:
matrix:
os:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/receive.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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

0 comments on commit 89fb99e

Please sign in to comment.