From c70d44f11e1f020e0a4d89aa0f849ca94a6e7aaa Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Fri, 31 Jul 2026 19:14:59 +1000 Subject: [PATCH] Triggered 'Vortex - Test docs' from both per-major test workflows. 'workflow_run' triggers are registered from the default branch only, so this file is the single definition serving branches of every major. Listening for 'Vortex - Test installer' alone leaves the required 'Vortex - Test docs' status unreported on '2.x', which ships 'Vortex - Test CLI' instead, blocking every '2.x' pull request. The artifact download now resolves from the triggering run rather than by workflow name, which selects the most recent successful run across all branches and can yield a binary built from an unrelated commit. --- .github/workflows/vortex-test-docs.yml | 24 ++++++++++++++++-------- .vortex/tests/zizmor.yml | 6 +++--- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/vortex-test-docs.yml b/.github/workflows/vortex-test-docs.yml index 1114649842..cebac434c9 100644 --- a/.github/workflows/vortex-test-docs.yml +++ b/.github/workflows/vortex-test-docs.yml @@ -1,27 +1,32 @@ # This action is used for Vortex maintenance. It will not be used in the scaffolded project. name: Vortex - Test docs +# Each major ships its own binary from its own workflow, so listen to both: +# 'workflow_run' is registered from the default branch only, making this the +# single definition that has to serve branches of either major. on: workflow_run: - workflows: ['Vortex - Test installer'] + workflows: ['Vortex - Test installer', 'Vortex - Test CLI'] types: - completed jobs: vortex-test-docs: runs-on: ubuntu-latest - # Only run if installer workflow succeeded + # Only run if the triggering workflow succeeded if: github.event.workflow_run.conclusion == 'success' permissions: contents: read # Checkout the repository at the triggering commit. - actions: read # Download the installer artifact from the test-installer workflow run. + actions: read # Download the binary artifact from the triggering workflow run. statuses: write # Post pending/final commit statuses via 'gh api repos/.../statuses/...'. pull-requests: write # Post the Netlify preview link comment on the originating PR. env: CURRENT_MAJOR: ${{ vars.VORTEX_CURRENT_MAJOR || '1' }} OTHER_MAJOR: ${{ (vars.VORTEX_CURRENT_MAJOR || '1') == '1' && '2' || '1' }} + BINARY_ARTIFACT: ${{ github.event.workflow_run.name == 'Vortex - Test CLI' && 'vortex-cli' || 'vortex-installer' }} + BINARY_FILE: ${{ github.event.workflow_run.name == 'Vortex - Test CLI' && 'vortex.phar' || 'installer.phar' }} steps: # Post pending status to the PR commit. @@ -55,18 +60,21 @@ jobs: with: php-version: 8.3 - - name: Download installer artifact + # Pin the download to the triggering run rather than a workflow name: + # searching by name returns the most recent successful run across all + # branches, which would pull a binary built from a different commit. + - name: Download the binary artifact uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21 with: - workflow: vortex-test-installer.yml - name: vortex-installer + run_id: ${{ github.event.workflow_run.id }} + name: ${{ env.BINARY_ARTIFACT }} path: .vortex/docs/static if_no_artifact_found: fail allow_forks: true - - name: Copy installer to docs + - name: Copy the binary to docs run: | - mv .vortex/docs/static/installer.phar .vortex/docs/static/install + mv ".vortex/docs/static/${BINARY_FILE}" .vortex/docs/static/install php .vortex/docs/static/install --version - name: Check docs up-to-date diff --git a/.vortex/tests/zizmor.yml b/.vortex/tests/zizmor.yml index b4cc996dd3..d8f7ad37d7 100644 --- a/.vortex/tests/zizmor.yml +++ b/.vortex/tests/zizmor.yml @@ -17,9 +17,9 @@ rules: # needs a write token on fork PRs and never checks out PR code. # - label-merge-conflict: labels PRs with merge-conflict status via # 'eps1lon/actions-label-merge-conflict'; never checks out PR code. - # - vortex-test-docs: chained run after 'Vortex - Test installer'; the - # 'head_sha' interpolation has been moved into 'env:' to remove the - # injection surface. + # - vortex-test-docs: chained run after a per-major test workflow; the + # 'head_sha' interpolation lives in 'env:' to remove the injection + # surface. ignore: - assign-author.yml - label-merge-conflict.yml