Repository navigation
Extract prompt bootstrap into a shared runtime helper - #76990
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Regenerate expected compiler output after extracting credential-free prompt bootstrap into setupPromptGlobals. Keep golden comparisons and normalization unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Ten golden fixtures still expect the old inline bootstrap and omit GH_AW_PROMPT_ENV, causing the corresponding TestWasmGolden_* subtests to fail.
1 open issue
What changed in this PR
Moves prompt initialization into a shared gh-aw runtime helper, reducing generated workflow duplication while retaining environment filtering and limited prompt globals.
Changes:
- Adds
setupPromptGlobalsand validated environment selection throughGH_AW_PROMPT_ENV. - Updates the compiler and generated workflow locks to use the helper.
- Adds regression coverage and documents the credential-isolation boundaries.
| File | Description |
|---|---|
pkg/workflow/credential_free_prompt.go |
Emits helper calls and selected environment names. |
pkg/workflow/credential_free_prompt_test.go |
Checks helper integration and credential filtering. |
docs/src/content/docs/reference/templating.md |
Documents shared bootstrap and environment selection. |
actions/setup/js/setup_prompt_globals.test.cjs |
Tests filtering, globals, and invalid configuration. |
actions/setup/js/setup_prompt_globals.cjs |
Implements shared prompt environment and global setup. |
.github/workflows/smoke-work-queue-worker.lock.yml |
Uses shared bootstrap in queue-worker prompts. |
.github/workflows/smoke-pi-auto.lock.yml |
Uses shared bootstrap in Pi smoke prompts. |
.github/workflows/smoke-github-codex.lock.yml |
Uses shared bootstrap in GitHub Codex prompts. |
.github/workflows/smoke-codex-routed.lock.yml |
Uses shared bootstrap in routed Codex prompts. |
.github/workflows/smoke-codex-routed-openai.lock.yml |
Uses shared bootstrap in OpenAI-routed prompts. |
.github/workflows/smoke-codex-bare-auto.lock.yml |
Uses shared bootstrap in bare Codex prompts. |
.github/workflows/smoke-codex-auto.lock.yml |
Uses shared bootstrap in Codex smoke prompts. |
.github/workflows/smoke-claude-sub-agents.lock.yml |
Uses shared bootstrap in Claude sub-agent prompts. |
.github/workflows/smoke-claude-dynamic.lock.yml |
Uses shared bootstrap in dynamic Claude prompts. |
.github/workflows/smoke-claude-copilot.lock.yml |
Uses shared bootstrap in Claude/Copilot prompts. |
.github/workflows/smoke-claude-copilot-auto.lock.yml |
Uses shared bootstrap in automatic Claude/Copilot prompts. |
.github/workflows/smoke-claude-auto.lock.yml |
Uses shared bootstrap in Claude smoke prompts. |
.github/workflows/smoke-azure-pi.lock.yml |
Uses shared bootstrap in Azure Pi prompts. |
.github/workflows/smoke-azure-codex.lock.yml |
Uses shared bootstrap in Azure Codex prompts. |
.github/workflows/smoke-agy.lock.yml |
Uses shared bootstrap in Agy smoke prompts. |
.github/workflows/sighthound-security-scan.lock.yml |
Uses shared bootstrap in security-scan prompts. |
.github/workflows/objective-impact-report.lock.yml |
Uses shared bootstrap in impact-report prompts. |
.github/workflows/firewall.lock.yml |
Uses shared bootstrap in firewall prompts. |
.github/workflows/example-permissions-warning.lock.yml |
Updates example prompt bootstrap. |
.github/workflows/example-failure-category-filter.lock.yml |
Updates failure-filter example prompt bootstrap. |
.github/workflows/eslint-factory-dispatcher.lock.yml |
Uses shared bootstrap in dispatcher prompts. |
.github/workflows/enterprise-docs-audit.lock.yml |
Uses shared bootstrap in documentation-audit prompts. |
.github/workflows/engine-conformance-pydantic-ai.lock.yml |
Updates Pydantic AI conformance prompt bootstrap. |
.github/workflows/engine-conformance-pi.lock.yml |
Updates Pi conformance prompt bootstrap. |
.github/workflows/engine-conformance-opencode.lock.yml |
Updates OpenCode conformance prompt bootstrap. |
.github/workflows/engine-conformance-kiro.lock.yml |
Updates Kiro conformance prompt bootstrap. |
.github/workflows/engine-conformance-goose.lock.yml |
Updates Goose conformance prompt bootstrap. |
.github/workflows/engine-conformance-gemini.lock.yml |
Updates Gemini conformance prompt bootstrap. |
.github/workflows/engine-conformance-factory.lock.yml |
Updates Factory conformance prompt bootstrap. |
.github/workflows/engine-conformance-cursor.lock.yml |
Updates Cursor conformance prompt bootstrap. |
.github/workflows/engine-conformance-crush.lock.yml |
Updates Crush conformance prompt bootstrap. |
.github/workflows/engine-conformance-copilot.lock.yml |
Updates Copilot conformance prompt bootstrap. |
.github/workflows/engine-conformance-codex.lock.yml |
Updates Codex conformance prompt bootstrap. |
.github/workflows/engine-conformance-claude.lock.yml |
Updates Claude conformance prompt bootstrap. |
.github/workflows/engine-conformance-atomic.lock.yml |
Updates Atomic conformance prompt bootstrap. |
.github/workflows/engine-conformance-agy.lock.yml |
Updates Agy conformance prompt bootstrap. |
.github/workflows/dev.lock.yml |
Uses shared bootstrap in development prompts. |
.github/workflows/designer-drift-audit.lock.yml |
Uses shared bootstrap in drift-audit prompts. |
.github/workflows/daily-work-queue-formal-verification.lock.yml |
Uses shared bootstrap in queue-verification prompts. |
.github/workflows/daily-team-status.lock.yml |
Uses shared bootstrap in team-status prompts. |
.github/workflows/daily-squid-image-scan.lock.yml |
Uses shared bootstrap in image-scan prompts. |
.github/workflows/daily-github-docs-seo-optimizer.lock.yml |
Uses shared bootstrap in SEO-optimizer prompts. |
.github/workflows/daily-credit-limit-test.lock.yml |
Uses shared bootstrap in credit-limit prompts. |
.github/workflows/daily-choice-test.lock.yml |
Uses shared bootstrap in choice-test prompts. |
.github/workflows/daily-byok-ollama-test.lock.yml |
Uses shared bootstrap in Ollama test prompts. |
.github/workflows/copilot-pr-merged-report.lock.yml |
Uses shared bootstrap in merged-PR report prompts. |
.github/workflows/copilot-centralization-drilldown.lock.yml |
Uses shared bootstrap in centralization-analysis prompts. |
.github/workflows/aw-issue-clustering.lock.yml |
Uses shared bootstrap in issue-clustering prompts. |
.github/workflows/auditor.lock.yml |
Uses shared bootstrap in auditor prompts. |
.github/workflows/agy-conformance-reusable.lock.yml |
Updates reusable Agy conformance prompt bootstrap. |
Review effort: Max (auto)
Contributor
|
🎉 This pull request is included in a new release. Release: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Generated prompt steps repeated an environment-filtering loop and assigned globals inline, adding noise to every lock file. Move that bootstrap into
setup_prompt_globals.cjs, following the existing shared-helper pattern while preserving credential isolation.The compiler passes selected environment names through
GH_AW_PROMPT_ENV; the helper retains those bindings and non-secret runner/context variables, removes inherited credentials and Node startup options, and exposes onlycoreandcontext. Regenerated 365 workflow locks remove roughly 3,300 lines of repeated code. Includes focused regression coverage and updated templating documentation.Validation
The final validation command initially stopped because ESLint tooling was missing. After restoring dependencies, the failed lint check and remaining workflow drift gate passed.