From 41d822d810c0a15c86a75c5d89532ed4838ea66e Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Sun, 8 Nov 2026 22:01:34 +0000 Subject: [PATCH 01/12] Use only main's artifacts for the Doors preview, as deploys now do Refs #960 Co-Authored-By: Claude Opus 5.5 --- .github/workflows/rebrand-preview.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rebrand-preview.yaml b/.github/workflows/rebrand-preview.yaml index 406a030f6f5..631ebe11f8f 100644 --- a/.github/workflows/rebrand-preview.yaml +++ b/.github/workflows/rebrand-preview.yaml @@ -76,6 +76,7 @@ jobs: path: ${{ runner.temp }}/artifacts/data github_token: ${{ secrets.GITHUB_TOKEN }} search_artifacts: true + branch: main # as in deploy.yaml: only main's runs, never a branch test run (#960) if_no_artifact_found: warn - name: Download announcements artifact @@ -87,6 +88,7 @@ jobs: path: ${{ runner.temp }}/artifacts/announcements github_token: ${{ secrets.GITHUB_TOKEN }} search_artifacts: true + branch: main # as in deploy.yaml: only main's runs, never a branch test run (#960) if_no_artifact_found: warn - name: Apply artifacts to both checkouts From 603af2ed5b741a1af4c559e9c529703ce93ef98f Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Sun, 8 Nov 2026 22:01:05 +0000 Subject: [PATCH 02/12] Use only main's data and announcement artifacts for deploys and staging deploy.yaml and staging-aggregate.yaml took the newest data-artifact from any branch, so a test dispatch of data-processing.yml from a branch could feed the live site. The artifact downloads now filter on branch main, the missing-artifact fallback always regenerates from main, and create_announcements.yml compares against main's previous announcements. The workflows README says how to try a branch's artifact instead. Fixes #960 Co-Authored-By: Claude Opus 5.5 --- .github/workflows/README.md | 2 ++ .github/workflows/create_announcements.yml | 1 + .github/workflows/deploy.yaml | 9 ++++----- .github/workflows/staging-aggregate.yaml | 8 +++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 197bc58b546..cb27c16d127 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -31,6 +31,8 @@ This document describes the GitHub Actions workflows used in the FORRT website r Builds the Hugo site and deploys to GitHub Pages (`gh-pages` branch). +It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. A `data-processing.yml` or `create_announcements.yml` run dispatched from another branch, for example to test a pipeline change, produces an artifact that deploys and staging ignore (#960). To try such an artifact, download it from the run and build locally. If no artifact is found, the fallback dispatches `data-processing.yml` on `main`. + ### [staging-aggregate.yaml](staging-aggregate.yaml) **Staging deployment for pull requests** diff --git a/.github/workflows/create_announcements.yml b/.github/workflows/create_announcements.yml index 71b0cf9cc4f..ba0a646026a 100644 --- a/.github/workflows/create_announcements.yml +++ b/.github/workflows/create_announcements.yml @@ -49,6 +49,7 @@ jobs: path: .prev github_token: ${{ secrets.GITHUB_TOKEN }} search_artifacts: true + branch: main # only main's runs feed deploys; branch test runs must not (#960) if_no_artifact_found: warn - name: Seed previous hash diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 97cb39b7f6f..170dc7d48af 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -64,6 +64,7 @@ jobs: path: . github_token: ${{ secrets.GITHUB_TOKEN }} search_artifacts: true + branch: main # only main's runs feed deploys; branch test runs must not (#960) if_no_artifact_found: warn # ======================= @@ -89,11 +90,8 @@ jobs: exit 0 fi - # Determine branch ref to dispatch (must be a branch or tag) - REF="${GITHUB_REF#refs/heads/}" - if [ -z "$REF" ]; then - REF="main" - fi + # Always regenerate from main: deploys use main's data only (#960) + REF="main" echo "🚀 Dispatching data-processing workflow for ref: $REF because artifact was missing" curl -s -X POST \ @@ -172,6 +170,7 @@ jobs: path: .announcements github_token: ${{ secrets.GITHUB_TOKEN }} search_artifacts: true + branch: main # only main's runs feed deploys; branch test runs must not (#960) if_no_artifact_found: warn - name: Apply announcements diff --git a/.github/workflows/staging-aggregate.yaml b/.github/workflows/staging-aggregate.yaml index 7bdc77c4c89..982ac43c5a1 100644 --- a/.github/workflows/staging-aggregate.yaml +++ b/.github/workflows/staging-aggregate.yaml @@ -284,6 +284,7 @@ jobs: path: .staging-data-artifact github_token: ${{ secrets.GITHUB_TOKEN }} search_artifacts: true + branch: main # only main's runs feed deploys; branch test runs must not (#960) if_no_artifact_found: warn - name: Select newer committed or artifact data @@ -310,11 +311,8 @@ jobs: exit 0 fi - # Determine branch ref to dispatch (must be a branch or tag) - REF="${GITHUB_REF#refs/heads/}" - if [ -z "$REF" ]; then - REF="main" - fi + # Always regenerate from main: deploys use main's data only (#960) + REF="main" echo "🚀 Dispatching data-processing workflow for ref: $REF because artifact was missing" curl -s -X POST \ From c5a6288237912968de01fd2bd912e3c4c4412858 Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Sun, 8 Nov 2026 22:06:08 +0000 Subject: [PATCH 03/12] Let a manual staging run use a named branch's data artifact staging-aggregate.yaml gains a data_branch dispatch input. Left empty, staging uses main's artifact like production; set, it stages that branch's data, so a change to data-processing.yml can still be tried on staging. Production deploys stay main-only. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/README.md | 2 +- .github/workflows/staging-aggregate.yaml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index cb27c16d127..b71dfef61ce 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -31,7 +31,7 @@ This document describes the GitHub Actions workflows used in the FORRT website r Builds the Hugo site and deploys to GitHub Pages (`gh-pages` branch). -It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. A `data-processing.yml` or `create_announcements.yml` run dispatched from another branch, for example to test a pipeline change, produces an artifact that deploys and staging ignore (#960). To try such an artifact, download it from the run and build locally. If no artifact is found, the fallback dispatches `data-processing.yml` on `main`. +It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. A `data-processing.yml` or `create_announcements.yml` run dispatched from another branch, for example to test a pipeline change, produces an artifact that deploys and staging ignore (#960). To stage such an artifact, run `data-processing.yml` on the branch, then dispatch `staging-aggregate.yaml` with `data_branch` set to that branch (combine with `single_pr` to stage only the PR that changes the pipeline). Production never uses it. If no artifact is found, the fallback dispatches `data-processing.yml` on `main`. ### [staging-aggregate.yaml](staging-aggregate.yaml) **Staging deployment for pull requests** diff --git a/.github/workflows/staging-aggregate.yaml b/.github/workflows/staging-aggregate.yaml index 982ac43c5a1..751a8ee9cbd 100644 --- a/.github/workflows/staging-aggregate.yaml +++ b/.github/workflows/staging-aggregate.yaml @@ -39,6 +39,11 @@ on: required: false type: boolean default: false + data_branch: + description: 'Use the data artifact from this branch instead of main (to stage a data-processing change; run data-processing.yml on that branch first)' + required: false + type: string + default: '' # Workflow-level concurrency to queue staging builds (wait instead of cancel) concurrency: @@ -284,7 +289,8 @@ jobs: path: .staging-data-artifact github_token: ${{ secrets.GITHUB_TOKEN }} search_artifacts: true - branch: main # only main's runs feed deploys; branch test runs must not (#960) + # main's runs only, unless a manual run names a branch to stage its data (#960) + branch: ${{ github.event.inputs.data_branch || 'main' }} if_no_artifact_found: warn - name: Select newer committed or artifact data From 2f017f4b1ba77590dbc8cf9fd3206c8274282a6e Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Sun, 8 Nov 2026 22:06:20 +0000 Subject: [PATCH 04/12] Document the data_branch staging input Co-Authored-By: Claude Opus 5.5 --- .github/workflows/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index b71dfef61ce..3b1c61b6c59 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -31,7 +31,7 @@ This document describes the GitHub Actions workflows used in the FORRT website r Builds the Hugo site and deploys to GitHub Pages (`gh-pages` branch). -It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. A `data-processing.yml` or `create_announcements.yml` run dispatched from another branch, for example to test a pipeline change, produces an artifact that deploys and staging ignore (#960). To stage such an artifact, run `data-processing.yml` on the branch, then dispatch `staging-aggregate.yaml` with `data_branch` set to that branch (combine with `single_pr` to stage only the PR that changes the pipeline). Production never uses it. If no artifact is found, the fallback dispatches `data-processing.yml` on `main`. +It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. A `data-processing.yml` or `create_announcements.yml` run dispatched from another branch, for example to test a pipeline change, produces an artifact that production ignores, and staging ignores unless asked (#960). To stage such an artifact, run `data-processing.yml` on the branch, then dispatch `staging-aggregate.yaml` with `data_branch` set to that branch (combine with `single_pr` to stage only the PR that changes the pipeline). Production never uses it. If no artifact is found, the fallback dispatches `data-processing.yml` on `main`. ### [staging-aggregate.yaml](staging-aggregate.yaml) **Staging deployment for pull requests** @@ -159,4 +159,5 @@ All workflows support `workflow_dispatch` for manual execution via GitHub Action | `cleanup-branches` | `dry_run` | Preview deletions without executing | | `staging-aggregate` | `force_deploy` | Deploy even with no PRs | | `staging-aggregate` | `single_pr` | Deploy only specified PR number | +| `staging-aggregate` | `data_branch` | Use that branch's data artifact instead of main's | | `data-processing` | `skip_deploy` | Skip triggering production deploy | From 07e5691ac919cf4d50bbbbbd26f0198544aa97db Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Sun, 8 Nov 2026 22:06:58 +0000 Subject: [PATCH 05/12] Make the missing-artifact fallback fire, and track only the run it dispatches The initial data downloads used if_no_artifact_found: warn, which succeeds, so the fallback (which runs on failure) never did; with the main-only filter that could leave a deploy without data. They now fail, with continue-on-error, so the fallback dispatches data-processing on main. The fallback then only follows runs created after its own dispatch. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/deploy.yaml | 6 ++++-- .github/workflows/staging-aggregate.yaml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 170dc7d48af..d475a9d898b 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -65,7 +65,7 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} search_artifacts: true branch: main # only main's runs feed deploys; branch test runs must not (#960) - if_no_artifact_found: warn + if_no_artifact_found: fail # continue-on-error is set; failure triggers the fallback below # ======================= # Data Processing (Fallback) @@ -93,6 +93,8 @@ jobs: # Always regenerate from main: deploys use main's data only (#960) REF="main" + # Only runs created from now on can be the one this job dispatches + SINCE=$(date -u -d '-5 seconds' +%Y-%m-%dT%H:%M:%SZ) echo "🚀 Dispatching data-processing workflow for ref: $REF because artifact was missing" curl -s -X POST \ -H "Authorization: Bearer $GITHUB_TOKEN" \ @@ -115,7 +117,7 @@ jobs: while [ $attempts -lt $max_attempts ]; do # Get the latest run triggered by workflow_dispatch runs_json=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github+json" \ - "https://api.github.com/repos/${{ github.repository }}/actions/workflows/data-processing.yml/runs?event=workflow_dispatch&branch=$REF&per_page=1") + "https://api.github.com/repos/${{ github.repository }}/actions/workflows/data-processing.yml/runs?event=workflow_dispatch&branch=$REF&created=%3E%3D$SINCE&per_page=1") run_id=$(echo "$runs_json" | jq -r '.workflow_runs[0].id') status=$(echo "$runs_json" | jq -r '.workflow_runs[0].status') diff --git a/.github/workflows/staging-aggregate.yaml b/.github/workflows/staging-aggregate.yaml index 751a8ee9cbd..2d03ac1d2fc 100644 --- a/.github/workflows/staging-aggregate.yaml +++ b/.github/workflows/staging-aggregate.yaml @@ -291,7 +291,7 @@ jobs: search_artifacts: true # main's runs only, unless a manual run names a branch to stage its data (#960) branch: ${{ github.event.inputs.data_branch || 'main' }} - if_no_artifact_found: warn + if_no_artifact_found: fail # continue-on-error is set; failure triggers the fallback below - name: Select newer committed or artifact data if: steps.download-artifact.outcome == 'success' @@ -320,6 +320,8 @@ jobs: # Always regenerate from main: deploys use main's data only (#960) REF="main" + # Only runs created from now on can be the one this job dispatches + SINCE=$(date -u -d '-5 seconds' +%Y-%m-%dT%H:%M:%SZ) echo "🚀 Dispatching data-processing workflow for ref: $REF because artifact was missing" curl -s -X POST \ -H "Authorization: Bearer $GITHUB_TOKEN" \ @@ -342,7 +344,7 @@ jobs: while [ $attempts -lt $max_attempts ]; do # Get the latest run triggered by workflow_dispatch runs_json=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github+json" \ - "https://api.github.com/repos/${{ github.repository }}/actions/workflows/data-processing.yml/runs?event=workflow_dispatch&branch=$REF&per_page=1") + "https://api.github.com/repos/${{ github.repository }}/actions/workflows/data-processing.yml/runs?event=workflow_dispatch&branch=$REF&created=%3E%3D$SINCE&per_page=1") run_id=$(echo "$runs_json" | jq -r '.workflow_runs[0].id') status=$(echo "$runs_json" | jq -r '.workflow_runs[0].status') From 92f31fb6bd68f2c5022b3ced99bab885ad978e22 Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Sun, 8 Nov 2026 22:08:01 +0000 Subject: [PATCH 06/12] Fail a staging run that names a branch whose data artifact is missing With data_branch set, staging used to fall back to committed or main data, which would misrepresent a pipeline test. It now stops with an error instead; the main fallback is kept for default runs. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/staging-aggregate.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/staging-aggregate.yaml b/.github/workflows/staging-aggregate.yaml index 2d03ac1d2fc..def59b73d3d 100644 --- a/.github/workflows/staging-aggregate.yaml +++ b/.github/workflows/staging-aggregate.yaml @@ -302,9 +302,15 @@ jobs: # ======================= # Data Processing (Fallback) # ======================= + - name: Stop if the requested branch's data artifact is missing + if: steps.download-artifact.outcome == 'failure' && github.event.inputs.data_branch != '' + run: | + echo "::error::No data artifact from branch '${{ github.event.inputs.data_branch }}'. Run data-processing.yml on that branch first; staging won't substitute main's data." + exit 1 + - name: Run data processing if artifact missing id: data-processing - if: steps.download-artifact.outcome == 'failure' + if: steps.download-artifact.outcome == 'failure' && github.event.inputs.data_branch == '' env: GITHUB_TOKEN: ${{ secrets.FORRT_PAT }} run: | From 33c2a894305edf40de0c0ddddfb265f46c4b31d3 Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Sun, 8 Nov 2026 22:11:32 +0000 Subject: [PATCH 07/12] Compare announcements with the same branch's previous run, and clarify the fallback create_announcements.yml's change detection now looks up the previous artifact from its own branch (main for scheduled runs), so a branch test run isn't skipped as unchanged against main's hash. Deploys still take only main's announcements. The README says that only a missing data artifact is regenerated. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/README.md | 2 +- .github/workflows/create_announcements.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 3b1c61b6c59..4f23b93373c 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -31,7 +31,7 @@ This document describes the GitHub Actions workflows used in the FORRT website r Builds the Hugo site and deploys to GitHub Pages (`gh-pages` branch). -It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. A `data-processing.yml` or `create_announcements.yml` run dispatched from another branch, for example to test a pipeline change, produces an artifact that production ignores, and staging ignores unless asked (#960). To stage such an artifact, run `data-processing.yml` on the branch, then dispatch `staging-aggregate.yaml` with `data_branch` set to that branch (combine with `single_pr` to stage only the PR that changes the pipeline). Production never uses it. If no artifact is found, the fallback dispatches `data-processing.yml` on `main`. +It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. A `data-processing.yml` or `create_announcements.yml` run dispatched from another branch, for example to test a pipeline change, produces an artifact that production ignores, and staging ignores unless asked (#960). To stage such an artifact, run `data-processing.yml` on the branch, then dispatch `staging-aggregate.yaml` with `data_branch` set to that branch (combine with `single_pr` to stage only the PR that changes the pipeline). Production never uses it. If the data artifact is missing, the fallback dispatches `data-processing.yml` on `main`; a missing announcements artifact is not regenerated by these workflows. ### [staging-aggregate.yaml](staging-aggregate.yaml) **Staging deployment for pull requests** diff --git a/.github/workflows/create_announcements.yml b/.github/workflows/create_announcements.yml index ba0a646026a..8507fd22bce 100644 --- a/.github/workflows/create_announcements.yml +++ b/.github/workflows/create_announcements.yml @@ -49,7 +49,7 @@ jobs: path: .prev github_token: ${{ secrets.GITHUB_TOKEN }} search_artifacts: true - branch: main # only main's runs feed deploys; branch test runs must not (#960) + branch: ${{ github.ref_name }} # compare with this branch's own previous run; deploys take main's only (#960) if_no_artifact_found: warn - name: Seed previous hash From 39c42e3ba2ff7c83aa5671ce234bc3ea288e4d8a Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Sun, 8 Nov 2026 22:18:34 +0000 Subject: [PATCH 08/12] Leave create_announcements.yml to #1030's PR, and stage a branch's preview artifact #1059 (#1030) renames branch-run artifacts to data-artifact-preview and announcements-artifact-preview and reworks create_announcements.yml, so this PR no longer touches that file. A staging run with data_branch now downloads that branch's data-artifact-preview. Merge #1059 first. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/README.md | 2 +- .github/workflows/create_announcements.yml | 1 - .github/workflows/staging-aggregate.yaml | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 4f23b93373c..21ee2534a16 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -31,7 +31,7 @@ This document describes the GitHub Actions workflows used in the FORRT website r Builds the Hugo site and deploys to GitHub Pages (`gh-pages` branch). -It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. A `data-processing.yml` or `create_announcements.yml` run dispatched from another branch, for example to test a pipeline change, produces an artifact that production ignores, and staging ignores unless asked (#960). To stage such an artifact, run `data-processing.yml` on the branch, then dispatch `staging-aggregate.yaml` with `data_branch` set to that branch (combine with `single_pr` to stage only the PR that changes the pipeline). Production never uses it. If the data artifact is missing, the fallback dispatches `data-processing.yml` on `main`; a missing announcements artifact is not regenerated by these workflows. +It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. A `data-processing.yml` or `create_announcements.yml` run dispatched from another branch, for example to test a pipeline change, produces an artifact that production ignores, and staging ignores unless asked (#960). To stage such an artifact (branch runs upload it as `data-artifact-preview`, #1030), run `data-processing.yml` on the branch, then dispatch `staging-aggregate.yaml` with `data_branch` set to that branch (combine with `single_pr` to stage only the PR that changes the pipeline). Production never uses it. If the data artifact is missing, the fallback dispatches `data-processing.yml` on `main`; a missing announcements artifact is not regenerated by these workflows. ### [staging-aggregate.yaml](staging-aggregate.yaml) **Staging deployment for pull requests** diff --git a/.github/workflows/create_announcements.yml b/.github/workflows/create_announcements.yml index 8507fd22bce..71b0cf9cc4f 100644 --- a/.github/workflows/create_announcements.yml +++ b/.github/workflows/create_announcements.yml @@ -49,7 +49,6 @@ jobs: path: .prev github_token: ${{ secrets.GITHUB_TOKEN }} search_artifacts: true - branch: ${{ github.ref_name }} # compare with this branch's own previous run; deploys take main's only (#960) if_no_artifact_found: warn - name: Seed previous hash diff --git a/.github/workflows/staging-aggregate.yaml b/.github/workflows/staging-aggregate.yaml index def59b73d3d..279fbd101bb 100644 --- a/.github/workflows/staging-aggregate.yaml +++ b/.github/workflows/staging-aggregate.yaml @@ -285,7 +285,8 @@ jobs: continue-on-error: true with: workflow: data-processing.yml - name: data-artifact + # Branch runs of data-processing.yml upload data-artifact-preview (#1030) + name: ${{ github.event.inputs.data_branch != '' && 'data-artifact-preview' || 'data-artifact' }} path: .staging-data-artifact github_token: ${{ secrets.GITHUB_TOKEN }} search_artifacts: true From 3083dcf46aac23e22fe94b3beb651bd6b485ed2f Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Sun, 8 Nov 2026 22:20:25 +0000 Subject: [PATCH 09/12] Pass data_branch through env, follow exactly the dispatched run, clarify the README - The staging error step no longer interpolates the data_branch input into its shell script; it reads it from an environment variable. - The missing-artifact fallback notes the newest data-processing run before it dispatches, then follows the first run newer than that. - The README says staging can opt in to a branch's data artifact only, never to branch announcement artifacts. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/README.md | 2 +- .github/workflows/deploy.yaml | 9 +++++---- .github/workflows/staging-aggregate.yaml | 13 ++++++++----- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 21ee2534a16..07ac4aec51f 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -31,7 +31,7 @@ This document describes the GitHub Actions workflows used in the FORRT website r Builds the Hugo site and deploys to GitHub Pages (`gh-pages` branch). -It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. A `data-processing.yml` or `create_announcements.yml` run dispatched from another branch, for example to test a pipeline change, produces an artifact that production ignores, and staging ignores unless asked (#960). To stage such an artifact (branch runs upload it as `data-artifact-preview`, #1030), run `data-processing.yml` on the branch, then dispatch `staging-aggregate.yaml` with `data_branch` set to that branch (combine with `single_pr` to stage only the PR that changes the pipeline). Production never uses it. If the data artifact is missing, the fallback dispatches `data-processing.yml` on `main`; a missing announcements artifact is not regenerated by these workflows. +It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. Runs of `data-processing.yml` or `create_announcements.yml` dispatched from another branch, for example to test a pipeline change, upload `*-preview` artifacts (#1030) that production never uses (#960). Staging can opt in to a branch's data artifact only; it never uses branch announcement artifacts. To stage branch data, run `data-processing.yml` on the branch, then dispatch `staging-aggregate.yaml` with `data_branch` set to that branch (combine with `single_pr` to stage only the PR that changes the pipeline). Production never uses it. If the data artifact is missing, the fallback dispatches `data-processing.yml` on `main`; a missing announcements artifact is not regenerated by these workflows. ### [staging-aggregate.yaml](staging-aggregate.yaml) **Staging deployment for pull requests** diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d475a9d898b..e6e43de5ded 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -93,8 +93,9 @@ jobs: # Always regenerate from main: deploys use main's data only (#960) REF="main" - # Only runs created from now on can be the one this job dispatches - SINCE=$(date -u -d '-5 seconds' +%Y-%m-%dT%H:%M:%SZ) + # The run this job dispatches is the first one newer than any that exists now + RUNS_URL="https://api.github.com/repos/${{ github.repository }}/actions/workflows/data-processing.yml/runs?event=workflow_dispatch&branch=$REF&per_page=100" + BEFORE=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github+json" "$RUNS_URL" | jq '[.workflow_runs[].id] | max // 0') echo "🚀 Dispatching data-processing workflow for ref: $REF because artifact was missing" curl -s -X POST \ -H "Authorization: Bearer $GITHUB_TOKEN" \ @@ -115,9 +116,9 @@ jobs: sleep 10 while [ $attempts -lt $max_attempts ]; do - # Get the latest run triggered by workflow_dispatch + # The first run created after the dispatch is ours runs_json=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github+json" \ - "https://api.github.com/repos/${{ github.repository }}/actions/workflows/data-processing.yml/runs?event=workflow_dispatch&branch=$REF&created=%3E%3D$SINCE&per_page=1") + "$RUNS_URL" | jq --argjson before "$BEFORE" '{workflow_runs: [.workflow_runs[] | select(.id > $before)] | sort_by(.id)}') run_id=$(echo "$runs_json" | jq -r '.workflow_runs[0].id') status=$(echo "$runs_json" | jq -r '.workflow_runs[0].status') diff --git a/.github/workflows/staging-aggregate.yaml b/.github/workflows/staging-aggregate.yaml index 279fbd101bb..ecbd153c186 100644 --- a/.github/workflows/staging-aggregate.yaml +++ b/.github/workflows/staging-aggregate.yaml @@ -305,8 +305,10 @@ jobs: # ======================= - name: Stop if the requested branch's data artifact is missing if: steps.download-artifact.outcome == 'failure' && github.event.inputs.data_branch != '' + env: + DATA_BRANCH: ${{ github.event.inputs.data_branch }} # via env, never interpolated into the script run: | - echo "::error::No data artifact from branch '${{ github.event.inputs.data_branch }}'. Run data-processing.yml on that branch first; staging won't substitute main's data." + echo "::error::No data artifact from branch \"$DATA_BRANCH\". Run data-processing.yml on that branch first; staging won't substitute main's data." exit 1 - name: Run data processing if artifact missing @@ -327,8 +329,9 @@ jobs: # Always regenerate from main: deploys use main's data only (#960) REF="main" - # Only runs created from now on can be the one this job dispatches - SINCE=$(date -u -d '-5 seconds' +%Y-%m-%dT%H:%M:%SZ) + # The run this job dispatches is the first one newer than any that exists now + RUNS_URL="https://api.github.com/repos/${{ github.repository }}/actions/workflows/data-processing.yml/runs?event=workflow_dispatch&branch=$REF&per_page=100" + BEFORE=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github+json" "$RUNS_URL" | jq '[.workflow_runs[].id] | max // 0') echo "🚀 Dispatching data-processing workflow for ref: $REF because artifact was missing" curl -s -X POST \ -H "Authorization: Bearer $GITHUB_TOKEN" \ @@ -349,9 +352,9 @@ jobs: sleep 10 while [ $attempts -lt $max_attempts ]; do - # Get the latest run triggered by workflow_dispatch + # The first run created after the dispatch is ours runs_json=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github+json" \ - "https://api.github.com/repos/${{ github.repository }}/actions/workflows/data-processing.yml/runs?event=workflow_dispatch&branch=$REF&created=%3E%3D$SINCE&per_page=1") + "$RUNS_URL" | jq --argjson before "$BEFORE" '{workflow_runs: [.workflow_runs[] | select(.id > $before)] | sort_by(.id)}') run_id=$(echo "$runs_json" | jq -r '.workflow_runs[0].id') status=$(echo "$runs_json" | jq -r '.workflow_runs[0].status') From 58e354bb72257af7399c933a2a40a4d1d930afe1 Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Sun, 8 Nov 2026 22:28:32 +0000 Subject: [PATCH 10/12] Treat data_branch=main as the default, and say a missing branch artifact stops staging Co-Authored-By: Claude Opus 5.5 --- .github/workflows/README.md | 2 +- .github/workflows/staging-aggregate.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 07ac4aec51f..195d123f1ff 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -31,7 +31,7 @@ This document describes the GitHub Actions workflows used in the FORRT website r Builds the Hugo site and deploys to GitHub Pages (`gh-pages` branch). -It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. Runs of `data-processing.yml` or `create_announcements.yml` dispatched from another branch, for example to test a pipeline change, upload `*-preview` artifacts (#1030) that production never uses (#960). Staging can opt in to a branch's data artifact only; it never uses branch announcement artifacts. To stage branch data, run `data-processing.yml` on the branch, then dispatch `staging-aggregate.yaml` with `data_branch` set to that branch (combine with `single_pr` to stage only the PR that changes the pipeline). Production never uses it. If the data artifact is missing, the fallback dispatches `data-processing.yml` on `main`; a missing announcements artifact is not regenerated by these workflows. +It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. Runs of `data-processing.yml` or `create_announcements.yml` dispatched from another branch, for example to test a pipeline change, upload `*-preview` artifacts (#1030) that production never uses (#960). Staging can opt in to a branch's data artifact only; it never uses branch announcement artifacts. To stage branch data, run `data-processing.yml` on the branch, then dispatch `staging-aggregate.yaml` with `data_branch` set to that branch (combine with `single_pr` to stage only the PR that changes the pipeline). Production never uses it. If a named branch has no data artifact, staging stops with an error rather than substituting `main`'s data. For default staging runs and production, a missing data artifact makes the fallback dispatch `data-processing.yml` on `main`; a missing announcements artifact is not regenerated by these workflows. ### [staging-aggregate.yaml](staging-aggregate.yaml) **Staging deployment for pull requests** diff --git a/.github/workflows/staging-aggregate.yaml b/.github/workflows/staging-aggregate.yaml index ecbd153c186..e60bfbb8b77 100644 --- a/.github/workflows/staging-aggregate.yaml +++ b/.github/workflows/staging-aggregate.yaml @@ -286,7 +286,7 @@ jobs: with: workflow: data-processing.yml # Branch runs of data-processing.yml upload data-artifact-preview (#1030) - name: ${{ github.event.inputs.data_branch != '' && 'data-artifact-preview' || 'data-artifact' }} + name: ${{ (github.event.inputs.data_branch != '' && github.event.inputs.data_branch != 'main') && 'data-artifact-preview' || 'data-artifact' }} path: .staging-data-artifact github_token: ${{ secrets.GITHUB_TOKEN }} search_artifacts: true @@ -304,7 +304,7 @@ jobs: # Data Processing (Fallback) # ======================= - name: Stop if the requested branch's data artifact is missing - if: steps.download-artifact.outcome == 'failure' && github.event.inputs.data_branch != '' + if: steps.download-artifact.outcome == 'failure' && github.event.inputs.data_branch != '' && github.event.inputs.data_branch != 'main' env: DATA_BRANCH: ${{ github.event.inputs.data_branch }} # via env, never interpolated into the script run: | @@ -313,7 +313,7 @@ jobs: - name: Run data processing if artifact missing id: data-processing - if: steps.download-artifact.outcome == 'failure' && github.event.inputs.data_branch == '' + if: steps.download-artifact.outcome == 'failure' && (github.event.inputs.data_branch == '' || github.event.inputs.data_branch == 'main') env: GITHUB_TOKEN: ${{ secrets.FORRT_PAT }} run: | From d7f4095f4194dd62d8b18dbdb80f2ce8a0985445 Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Sun, 8 Nov 2026 22:29:50 +0000 Subject: [PATCH 11/12] Fail the fallback step when GitHub rejects the data-processing dispatch curl -f turns an HTTP error from the dispatch API into a failure, so the existing error branch runs instead of waiting for a run that was never created. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/deploy.yaml | 2 +- .github/workflows/staging-aggregate.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index e6e43de5ded..60f85263b7a 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -97,7 +97,7 @@ jobs: RUNS_URL="https://api.github.com/repos/${{ github.repository }}/actions/workflows/data-processing.yml/runs?event=workflow_dispatch&branch=$REF&per_page=100" BEFORE=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github+json" "$RUNS_URL" | jq '[.workflow_runs[].id] | max // 0') echo "🚀 Dispatching data-processing workflow for ref: $REF because artifact was missing" - curl -s -X POST \ + curl -sSf -X POST \ -H "Authorization: Bearer $GITHUB_TOKEN" \ -H "Accept: application/vnd.github+json" \ "https://api.github.com/repos/${{ github.repository }}/actions/workflows/data-processing.yml/dispatches" \ diff --git a/.github/workflows/staging-aggregate.yaml b/.github/workflows/staging-aggregate.yaml index e60bfbb8b77..5c3a9caa33a 100644 --- a/.github/workflows/staging-aggregate.yaml +++ b/.github/workflows/staging-aggregate.yaml @@ -333,7 +333,7 @@ jobs: RUNS_URL="https://api.github.com/repos/${{ github.repository }}/actions/workflows/data-processing.yml/runs?event=workflow_dispatch&branch=$REF&per_page=100" BEFORE=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github+json" "$RUNS_URL" | jq '[.workflow_runs[].id] | max // 0') echo "🚀 Dispatching data-processing workflow for ref: $REF because artifact was missing" - curl -s -X POST \ + curl -sSf -X POST \ -H "Authorization: Bearer $GITHUB_TOKEN" \ -H "Accept: application/vnd.github+json" \ "https://api.github.com/repos/${{ github.repository }}/actions/workflows/data-processing.yml/dispatches" \ From 9ea53986e78e8f86eddc596a5dcef68c9a68cdf0 Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Sun, 8 Nov 2026 22:36:26 +0000 Subject: [PATCH 12/12] Say in the README that data_branch: main behaves like the default Co-Authored-By: Claude Opus 5.5 --- .github/workflows/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 195d123f1ff..2c15900a12f 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -31,7 +31,7 @@ This document describes the GitHub Actions workflows used in the FORRT website r Builds the Hugo site and deploys to GitHub Pages (`gh-pages` branch). -It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. Runs of `data-processing.yml` or `create_announcements.yml` dispatched from another branch, for example to test a pipeline change, upload `*-preview` artifacts (#1030) that production never uses (#960). Staging can opt in to a branch's data artifact only; it never uses branch announcement artifacts. To stage branch data, run `data-processing.yml` on the branch, then dispatch `staging-aggregate.yaml` with `data_branch` set to that branch (combine with `single_pr` to stage only the PR that changes the pipeline). Production never uses it. If a named branch has no data artifact, staging stops with an error rather than substituting `main`'s data. For default staging runs and production, a missing data artifact makes the fallback dispatch `data-processing.yml` on `main`; a missing announcements artifact is not regenerated by these workflows. +It uses the newest `data-artifact` and `announcements-artifact` from runs on `main` only. Runs of `data-processing.yml` or `create_announcements.yml` dispatched from another branch, for example to test a pipeline change, upload `*-preview` artifacts (#1030) that production never uses (#960). Staging can opt in to a branch's data artifact only; it never uses branch announcement artifacts. To stage branch data, run `data-processing.yml` on the branch, then dispatch `staging-aggregate.yaml` with `data_branch` set to that branch (combine with `single_pr` to stage only the PR that changes the pipeline). Production never uses it. If a branch other than `main` is named and has no data artifact, staging stops with an error rather than substituting `main`'s data (`data_branch: main` behaves like leaving it empty). For default staging runs and production, a missing data artifact makes the fallback dispatch `data-processing.yml` on `main`; a missing announcements artifact is not regenerated by these workflows. ### [staging-aggregate.yaml](staging-aggregate.yaml) **Staging deployment for pull requests**