Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
# take ~25s just to run git clone and restore node_modules.
lint-and-typecheck:
name: 'Lint and typecheck'
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -27,6 +28,7 @@ jobs:
- run: npx nx check-orphan-pages docs-site
- run: bash tools/check-node-engine-alignment.sh
test-unit-asyncify:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -75,6 +77,7 @@ jobs:
MYSQL_USER: user
MYSQL_PASSWORD: password
test-unit-jspi:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -121,6 +124,7 @@ jobs:
MYSQL_USER: user
MYSQL_PASSWORD: password
test-playground-cli:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
Expand All @@ -137,6 +141,7 @@ jobs:
- name: Run full test suite
run: node node_modules/nx/bin/nx affected --target=test-playground-cli
test-file-locking:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
Expand All @@ -154,6 +159,7 @@ jobs:
- name: Run full test suite
run: node node_modules/nx/bin/nx affected --target=test-file-locking-${{ matrix.async-strategy }}
test-e2e-php-wasm-web-jspi:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -163,6 +169,7 @@ jobs:
- run: sudo npx playwright install
- run: sudo CI=true JSPI=true npx nx e2e php-wasm-web
test-e2e-php-wasm-web-asyncify:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -172,6 +179,7 @@ jobs:
- run: sudo npx playwright install
- run: sudo CI=true npx nx e2e php-wasm-web
test-e2e:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
# Run as root to allow node to bind to port 80
steps:
Expand All @@ -191,6 +199,7 @@ jobs:
# Previously used a prepare job + artifact sharing, but inline builds allow
# all shards to start immediately in parallel, reducing total wall time.
test-e2e-playwright:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -290,6 +299,7 @@ jobs:
if-no-files-found: ignore

test-e2e-components:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -329,6 +339,7 @@ jobs:
if-no-files-found: ignore

test-docs-api-reference:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -347,6 +358,7 @@ jobs:
if-no-files-found: ignore

test-built-npm-packages:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -359,6 +371,7 @@ jobs:
run: packages/playground/test-built-npm-packages/run-tests.sh

test-running-unbuilt-playground-cli:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -370,6 +383,7 @@ jobs:
- run: packages/playground/cli/tests/test-running-unbuilt-cli.sh

test-php-wasm-cli-smoke:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -385,6 +399,7 @@ jobs:
# Redis requires JSPI because asyncify cannot properly handle exceptions
# during network I/O. Attempting to load Redis with asyncify throws an error.
test-redis-extension:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
services:
redis:
Expand Down Expand Up @@ -412,6 +427,7 @@ jobs:
# Memcached extension tests - verifies the php-memcached extension loads
# and provides the expected API, and can connect to a real memcached server.
test-memcached-extension:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
services:
memcached:
Expand All @@ -434,6 +450,7 @@ jobs:
MEMCACHED_PORT: 11211

build:
if: github.repository == 'WordPress/wordpress-playground' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-cors-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ concurrency:

jobs:
build_and_deploy:
# Only run this workflow from the trunk branch and when it's triggered by a maintainer listed below
# Only run this workflow on the playground repo, from the trunk branch, and when triggered by a maintainer listed below
# TODO: Can we check for group membership?
if: >
github.repository == 'WordPress/wordpress-playground' &&
github.ref == 'refs/heads/trunk' && (
github.event_name == 'workflow_run' ||
github.event_name == 'workflow_dispatch' ||
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-my-wordpress-net.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ concurrency:

jobs:
build_and_deploy:
# Only run this workflow from the trunk branch and when it's triggered by a Playground maintainer
# Only run this workflow on the playground repo, from the trunk branch, and when triggered by a Playground maintainer
if: >
github.repository == 'WordPress/wordpress-playground' &&
github.ref == 'refs/heads/trunk' && (
github.event_name == 'workflow_run' ||
(github.event_name == 'workflow_dispatch' && github.actor == 'github-actions[bot]') ||
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ concurrency:

jobs:
build_and_deploy:
# Only run this workflow from the trunk branch and when it's triggered by another workflow OR a Playground maintainer
# Only run this workflow on the playground repo, from the trunk branch, and when triggered by another workflow OR a Playground maintainer
if: >
github.repository == 'WordPress/wordpress-playground' &&
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The literal repository string WordPress/wordpress-playground is duplicated across many workflows in this PR, which makes future renames/error fixes repetitive and easier to miss. Consider centralizing it via a repo/org variable (e.g., vars.OFFICIAL_REPO) and comparing against that, or using a less brittle predicate like github.repository_owner == 'WordPress' combined with the repo name.

Suggested change
github.repository == 'WordPress/wordpress-playground' &&
github.repository_owner == 'WordPress' &&
github.event.repository.name == 'wordpress-playground' &&

Copilot uses AI. Check for mistakes.
github.ref == 'refs/heads/trunk' && (
github.event_name == 'workflow_run' ||
(github.event_name == 'workflow_dispatch' && github.actor == 'github-actions[bot]') ||
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish-devtools-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ on:

jobs:
publish:
# Only run this workflow from the trunk branch and when triggered by a Playground maintainer
# Only run this workflow on the playground repo, from the trunk branch, and when triggered by a Playground maintainer
if: >
github.repository == 'WordPress/wordpress-playground' &&
github.ref == 'refs/heads/trunk' && (
github.actor == 'adamziel' ||
github.actor == 'dmsnell' ||
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/publish-github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ permissions:

jobs:
create-release:
# Only create a release after a successful npm publish on trunk,
# or when triggered manually.
# Only run on the playground repo. Create a release after a successful
# npm publish on trunk, or when triggered manually.
if: >
github.event_name == 'workflow_dispatch' ||
github.repository == 'WordPress/wordpress-playground' &&
(
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch == 'trunk'
github.event_name == 'workflow_dispatch' ||
(
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch == 'trunk'
)
)

runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish-npm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ permissions:

jobs:
release:
# Only allow Playground maintainers to trigger this workflow.
# Only run on the playground repo, and only allow Playground maintainers to trigger this workflow.
# Non-trunk branches are allowed but require a custom dist tag (not "latest").
if: >
github.repository == 'WordPress/wordpress-playground' &&
(
github.actor == 'adamziel' ||
github.actor == 'dmsnell' ||
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish-self-hosted-package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ on:

jobs:
publish:
# Only run this workflow from the trunk branch and when it's triggered by a Playground maintainer
# Only run this workflow on the playground repo, from the trunk branch, and when triggered by a Playground maintainer
if: >
github.repository == 'WordPress/wordpress-playground' &&
github.ref == 'refs/heads/trunk' && (
github.actor == 'adamziel' ||
github.actor == 'dmsnell' ||
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/refresh-sqlite-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ on:

jobs:
build_and_deploy:
# Only run this workflow from the trunk branch and when it's triggered by a Playground maintainer
# Only run this workflow on the playground repo, from the trunk branch, and when triggered by a Playground maintainer
if: >
github.repository == 'WordPress/wordpress-playground' &&
github.ref == 'refs/heads/trunk' && (
github.actor == 'adamziel' ||
github.actor == 'dmsnell' ||
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/refresh-wordpress-major-and-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ concurrency:

jobs:
build_wordpress_major_and_beta_push_to_github_and_deploy_website:
# Only run this workflow from the trunk branch and when it's triggered by a Playground maintainer
# Only run this workflow on the playground repo, from the trunk branch, and when triggered by a Playground maintainer
if: >
github.repository == 'WordPress/wordpress-playground' &&
github.ref == 'refs/heads/trunk' && (
github.actor == 'adamziel' ||
github.actor == 'dmsnell' ||
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/refresh-wordpress-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ on:

jobs:
build_and_deploy:
# Only run this workflow from the trunk branch and when it's triggered by a Playground maintainer
# Only run this workflow on the playground repo, from the trunk branch, and when triggered by a Playground maintainer
if: >
github.repository == 'WordPress/wordpress-playground' &&
github.ref == 'refs/heads/trunk' && (
github.actor == 'adamziel' ||
github.actor == 'dmsnell' ||
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ on:

jobs:
release:
# Only run this workflow from the trunk branch and when it's triggered by a Playground maintainer
# Only run this workflow on the playground repo, from the trunk branch, and when triggered by a Playground maintainer
if: >
github.repository == 'WordPress/wordpress-playground' &&
github.ref == 'refs/heads/trunk' && (
Comment on lines 18 to 20
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says the guard is added to deploy/publish/refresh workflows, but this PR also updates update-changelog.yml. Either update the PR description to include this workflow or drop the change here to keep scope aligned.

Copilot uses AI. Check for mistakes.
github.event.workflow_run.conclusion == 'success' ||
github.actor == 'adamziel' ||
Expand Down
Loading