-
Notifications
You must be signed in to change notification settings - Fork 328
BUG: 'GH_HOST' set with GITHUB_OUTPUT (not env or env-threaded), breaking Process Safe Outputs on GHES #23093
Copy link
Copy link
Closed
Description
Summary
In the safe-outputs agentic workflow, the Configure GH_HOST for enterprise compatibility step is sometimes compiled to write GH_HOST into $GITHUB_OUTPUT rather than $GITHUB_ENV. The value is unused downstream (not picked up via env threading or steps.ghes-host-config.outputs.GH_HOST), so subsequent jobs referencing the gh CLI (notably Process Safe Outputs) default to public github.com instead of the expected GitHub Enterprise host.
What failed
- For steps on GHES,
GH_HOSTis expected to be available as an environment variable. Instead, it was written to$GITHUB_OUTPUTbut not surfaced into step/jobenv, so was never seen by subsequent steps.
Why it failed
- Compiler used an incorrect step template for
Configure GH_HOST for enterprise compatibility, writingGH_HOSTto$GITHUB_OUTPUTnot$GITHUB_ENV. - Downstream jobs failed to thread env (
env: GH_HOST: ${{ steps.ghes-host-config.outputs.GH_HOST }}) or lacked direct export.
Root cause
- Regression in the build template or generator for this step around the v0.64.0
$GITHUB_ENVhardening changes. The canonical code inpkg/workflow/ghes_host_step.gois correct; this suggests the error results from an intermediate template or missed job regeneration (stale.lock.yml).
Supporting evidence / References
- PR Review Copilot observation 2, 4, 6, 8, 10
- gh-aw source:
pkg/workflow/ghes_host_step.go,ghes_host_step_test.go(asserts only$GITHUB_ENVallowed) - Stale/incorrect output observed in generated
.lock.ymlin downstream repo
Proposed fix
- Confirm all template and generator code for this step only writes to
$GITHUB_ENV(never$GITHUB_OUTPUT). - Add compiler regression/integration tests for GHES env propagation, confirm subsequent steps have
env: GH_HOSTas required. - Document required env propagation explicitly for all steps that use the gh CLI under GHES.
Implementation plan
- Audit compiler generator and template code for all workflows that use the GHES host step.
- Fix any places writing
GH_HOSTinto the wrong context or failing to propagate it properly. - Add unit and .lock.yml output tests for GHES jobs to assert correct env presence.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Fields
Give feedbackNo fields configured for issues without a type.