mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-06 17:49:07 -05:00
[PR #1344] [MERGED] fix(ci): move path vars to workflow-level env so fork PRs can build #8133
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1344
Author: @profvjreddi
Created: 4/16/2026
Status: ✅ Merged
Merged: 4/16/2026
Merged by: @profvjreddi
Base:
dev← Head:fix/labs-ci-fork-pr-variable📝 Commits (1)
b677579fix(ci): move path vars to workflow-level env so fork PRs can build📊 Changes
3 files changed (+30 additions, -9 deletions)
View changed files
📝
.github/workflows/kits-validate-dev.yml(+10 -3)📝
.github/workflows/labs-validate-dev.yml(+10 -3)📝
.github/workflows/mlsysim-validate-dev.yml(+10 -3)📄 Description
problem
repository variables (
vars.LABS_ROOT,vars.KITS_ROOT,vars.MLSYSIM_DOCS) are not exposed to workflows triggered bypull_requestevents from forks. this is a github security default, not a misconfiguration.when a fork PR modifies files under
labs/,kits/, ormlsysim/, the validate-dev workflow runs andvars.*resolves to empty string. this causes:working-directory: ${{ vars.LABS_ROOT }}becomes empty, soquarto renderruns from the repo root instead oflabs//_build/index.html(absolute root with leading slash) instead oflabs/_build/index.htmlevidence: on #1306, #1331, #1339 the CI log shows
if [ ! -f "/_build/index.html" ]. on dev it showsif [ ! -f "labs/_build/index.html" ]. same workflow, different resolution depending on fork vs non-fork context.fix
declare the path at workflow level via
env:, notvars:. workflow env is available in all contexts including fork PRs. the abstraction (named variable) is preserved, storage just moves from repo-level to file-level. the value is effectively a constant anyway.changed files:
.github/workflows/labs-validate-dev.yml—LABS_ROOT: labs.github/workflows/kits-validate-dev.yml—KITS_ROOT: kits.github/workflows/mlsysim-validate-dev.yml—MLSYSIM_DOCS: mlsysim/docsscope
only the three validate-dev workflows that trigger on
pull_requestevents. other workflows usingvars.*run onpush,workflow_run, orworkflow_dispatchwhere repo vars are available, so they are correct as written.impact
once merged, re-running CI on open fork PRs (#1306, #1331, #1339) will use this fixed workflow file and produce real build signal for the first time. the three fork PRs have been stuck on this CI failure for days through no fault of their authors.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.