Skip to content
Merged
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
24 changes: 16 additions & 8 deletions .github/workflows/vortex-test-docs.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Comment thread
coderabbitai[bot] marked this conversation as resolved.
php .vortex/docs/static/install --version

- name: Check docs up-to-date
Expand Down
6 changes: 3 additions & 3 deletions .vortex/tests/zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down