Skip to content

Commit 802be89

Browse files
committed
test gated workflow
1 parent 9aa70b9 commit 802be89

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Community PRs – Approved to Run Workflows
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, synchronize, reopened, labeled]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
run-with-approval:
12+
if: >
13+
github.event.pull_request.head.repo.fork == true &&
14+
contains(github.event.pull_request.labels.*.name, 'run-workflows')
15+
16+
environment: external-prs # approval gate; no env secrets needed
17+
18+
uses: ./github/workflows/pr-playwright-tests.yml
19+
with:
20+
pr_repo: ${{ github.event.pull_request.head.repo.full_name }}
21+
pr_sha: ${{ github.event.pull_request.head.sha }}
22+
# If your policy forbids forks on self-hosted runners, uncomment:
23+
# runner: '["ubuntu-latest"]'
24+
secrets: inherit

.github/workflows/pr-playwright-tests.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
name: Run Playwright Tests
2+
3+
on:
4+
push: # Internal runs
5+
workflow_call: # Allows a caller to run this against a fork/community PR
6+
inputs:
7+
pr_repo:
8+
type: string
9+
required: false
10+
default: ${{ github.repository }}
11+
pr_sha:
12+
type: string
13+
required: false
14+
default: ${{ github.sha }}
15+
# Optional: let the caller switch runners for forks
16+
runner:
17+
type: string
18+
required: false
19+
default: '["runs-on","runner=32cpu-linux-x64","disk=large","run-id=${{ github.run_id }}"]'
20+
221
concurrency:
322
group: Run-Playwright-Tests-${{ github.workflow }}-${{ github.head_ref || github.event.workflow_run.head_branch || github.run_id }}
423
cancel-in-progress: true
5-
6-
on: push
7-
24+
825
env:
926
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
1027
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 commit comments

Comments
 (0)