Fix compiler obfuscation: Don't wrap static quoted values in ${{ }}#14257
Fix compiler obfuscation: Don't wrap static quoted values in ${{ }}#14257
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the workflow compiler’s placeholder-substitution env generation so that static quoted string literals are emitted as plain YAML strings (instead of being wrapped in ${{ }}), reducing zizmor “obfuscation” findings across generated workflow lockfiles.
Changes:
- Adjust
generatePlaceholderSubstitutionStep()to emit quoted static values directly and only wrap non-quoted content in${{ }}. - Add a focused unit test for placeholder substitution behavior and update multiple integration tests to match the new output.
- Regenerate compiled workflow
.lock.ymlfiles to reflect the new env formatting.
Reviewed changes
Copilot reviewed 66 out of 66 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/compiler_yaml_helpers.go | Changes placeholder substitution env rendering to avoid ${{ }} wrapping for quoted static values. |
| pkg/workflow/compiler_yaml_helpers_test.go | Adds unit tests covering static/expression/mixed placeholder substitution cases. |
| pkg/workflow/cache_memory_integration_test.go | Updates integration expectations for cache-memory env var formatting. |
| pkg/workflow/prompts_test.go | Updates generated workflow assertion for cache dir env var formatting. |
| pkg/workflow/unified_prompt_creation_test.go | Updates assertions for cache dir env var formatting in unified prompt creation output. |
| .github/workflows/weekly-issue-summary.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/unbloat-docs.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/test-create-pr-error-handling.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/technical-doc-writer.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/super-linter.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/step-name-alignment.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/static-analysis-report.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/stale-repo-identifier.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/smoke-copilot.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/smoke-codex.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/smoke-claude.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/slide-deck-maintainer.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/sergo.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/security-review.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/scout.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/schema-consistency-checker.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/safe-output-health.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/q.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/python-data-charts.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/prompt-clustering-analysis.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/pr-nitpick-reviewer.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/portfolio-analyst.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/poem-bot.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/pdf-summary.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/org-health-report.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/mcp-inspector.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/lockfile-stats.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/jsweep.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/instructions-janitor.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/grumpy-reviewer.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/go-logger.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/go-fan.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/glossary-maintainer.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/github-mcp-tools-report.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/github-mcp-structural-analysis.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/firewall-escape.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/developer-docs-consolidator.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/deep-report.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/daily-safe-output-optimizer.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/daily-repo-chronicle.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/daily-performance-summary.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/daily-news.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/daily-mcp-concurrency-analysis.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/daily-issues-report.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/daily-firewall-report.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/daily-doc-updater.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/daily-copilot-token-report.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/daily-compiler-quality.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/daily-code-metrics.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/copilot-session-insights.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/copilot-pr-prompt-analysis.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/copilot-pr-nlp-analysis.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/copilot-agent-analysis.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/code-scanning-fixer.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/cloclo.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/cli-version-checker.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/claude-code-user-docs-review.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/ci-doctor.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/ci-coach.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/audit-workflows.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
| .github/workflows/agent-persona-explorer.lock.yml | Regenerated lockfile reflecting unwrapped quoted cache env values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Check if this is a static quoted value (starts and ends with quotes) | ||
| if (strings.HasPrefix(content, "'") && strings.HasSuffix(content, "'")) || | ||
| (strings.HasPrefix(content, "\"") && strings.HasSuffix(content, "\"")) { | ||
| // Static value - output directly without ${{ }} wrapper | ||
| fmt.Fprintf(yaml, indent+" %s: %s\n", mapping.EnvVar, content) | ||
| } else { | ||
| // GitHub expression - wrap in ${{ }} | ||
| fmt.Fprintf(yaml, indent+" %s: ${{ %s }}\n", mapping.EnvVar, content) | ||
| } |
There was a problem hiding this comment.
The quoted-string detection is too broad: an expression like "'foo' || 'bar'" (or other expressions that start/end with quotes but contain operators) would be misclassified as a static value and emitted without ${{ }}, producing invalid YAML / wrong runtime behavior. Consider tightening the check to only treat the content as static when it is entirely a single quoted string literal (e.g., regex/parse that matches a full single- or double-quoted literal, including escaped quotes), otherwise keep wrapping in ${{ }}.
| }, | ||
| }, | ||
| { | ||
| name: "github expressions wrapped in ${{}}}", |
There was a problem hiding this comment.
Test case name has an extra closing brace (${{}}}) which looks like a typo and makes the table-driven test output harder to read; consider renaming it to reflect the intended ${{ }} wrapping.
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges... |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
❌ Changeset Generator failed. Please review the logs for details. |
|
📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident... |
The workflow compiler was wrapping static quoted strings in
${{ }}expressions, triggering 122 zizmor obfuscation warnings across all compiled workflows.Problem
generatePlaceholderSubstitutionStep()incompiler_yaml_helpers.gowrapped allExpressionMapping.Contentvalues in${{ }}, including static strings:Changes
compiler_yaml_helpers.go: Detect quoted strings (start/end with'or") and output directly. Only wrap GitHub expressions likegithub.repositoryin${{ }}TestGeneratePlaceholderSubstitutionStepwith static/expression/mixed cases.lock.ymlfilesImpact
Eliminates 122 false positive security warnings (67% reduction from 182 to 60 total findings).
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/woodruffw/zizmor/releases/latest/usr/bin/curl curl -s REDACTED(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.