Skip to content

Replace ${{ '' }} with "" in activation job outputs to eliminate zizmor obfuscation warnings - #4398

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-zizmor-warning-activation-job
Nov 20, 2025
Merged

pelikhan merged 2 commits into
mainfrom
copilot/fix-zizmor-warning-activation-job

Conversation

Copilot AI commented Nov 20, 2025 •

Copy link
Copy Markdown
Contributor

Zizmor flagged 72 instances of ${{ '' }} in activation job outputs as potential obfuscation. While functionally correct, this unusual syntax for empty values triggers false positives.

Change

Modified pkg/workflow/compiler_jobs.go to use plain quoted empty strings:

// Before
outputs["comment_id"] = "${{ '' }}"
outputs["comment_repo"] = "${{ '' }}"

// After  
outputs["comment_id"] = `""`
outputs["comment_repo"] = `""`

Technical Note

Using `""` (backtick-quoted) renders as comment_id: "" in YAML, which parses as an empty string. Plain "" would render as comment_id: (trailing space), which YAML treats as null.

Impact

  • Zizmor findings: 73 → 1 (98.6% reduction)
  • 68 workflows updated
  • No functional changes to workflow behavior
Original prompt

This section details on the original issue you should resolve

<issue_title>[task] Fix zizmor obfuscation warning by using plain empty strings in activation job outputs</issue_title>
<issue_description>## Objective
Replace ${{ '' }} expressions with plain empty strings "" in the activation job outputs to eliminate 72 zizmor obfuscation warnings across compiled workflows.

Context

The static analysis report (discussion #4380) identified 72 low-severity zizmor obfuscation warnings caused by the pattern:

outputs:
  comment_id: ${{ '' }}
  comment_repo: ${{ '' }}

This pattern is generated by the gh-aw compiler in pkg/workflow/compiler_jobs.go lines 670-675. While functionally correct, zizmor's heuristics flag this unusual syntax as potentially obfuscated code because using expressions for empty values is atypical.

Root Cause

The compiler uses ${{ '' }} to ensure empty string type in YAML (not null), but plain empty strings "" achieve the same result without triggering security scanners.

Approach

Modify pkg/workflow/compiler_jobs.go to use plain empty strings instead of expression syntax:

Current code (lines 670-675):

if _, exists := outputs["comment_id"]; !exists {
    outputs["comment_id"] = "${{ '' }}"
}
if _, exists := outputs["comment_repo"]; !exists {
    outputs["comment_repo"] = "${{ '' }}"
}

Proposed change:

if _, exists := outputs["comment_id"]; !exists {
    outputs["comment_id"] = ""
}
if _, exists := outputs["comment_repo"]; !exists {
    outputs["comment_repo"] = ""
}

Files to Modify

  • Update: pkg/workflow/compiler_jobs.go (lines 670-675)

Testing Requirements

  1. Run existing unit tests to ensure no regressions: make test-unit
  2. Compile several workflows and verify outputs are still valid: gh aw compile
  3. Recompile all workflows: make recompile
  4. Run zizmor scan to verify warnings are eliminated: gh aw compile --zizmor
  5. Verify that workflows with reactions still function correctly (comment_id and comment_repo are properly populated when needed)

Acceptance Criteria

  • compiler_jobs.go uses plain empty strings "" instead of ${{ '' }}
  • All existing tests pass
  • Compiled workflows have valid YAML syntax
  • Zizmor obfuscation warnings are eliminated (72 → 0)
  • Workflows with reactions continue to work correctly
  • All 45+ workflows recompiled successfully

Expected Impact

  • Reduces zizmor findings from 73 to 1 (only template-injection warning remains)
  • Improves security scan signal-to-noise ratio
  • No functional changes to workflow behavior
  • Cleaner, more idiomatic YAML output

Priority

Low - This is a security scanner false positive, not an actual vulnerability. However, fixing it reduces noise in security scans and follows YAML best practices.

AI generated by Plan Command for discussion #4380</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

This change eliminates 72 zizmor obfuscation warnings by using plain
quoted empty strings instead of expression syntax for default output values.

- Updated compiler_jobs.go to use `""` instead of `${{ '' }}`
- Updated comment to reflect the change
- All unit tests pass
- All 85 workflows compile successfully
- YAML parsing confirmed: empty strings remain empty strings (not null)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix zizmor obfuscation warning in activation job outputs Replace ${{ '' }} with "" in activation job outputs to eliminate zizmor obfuscation warnings Nov 20, 2025
Copilot AI requested a review from pelikhan November 20, 2025 15:57
@pelikhan
pelikhan marked this pull request as ready for review November 20, 2025 16:00
Copilot AI review requested due to automatic review settings November 20, 2025 16:00
@pelikhan
pelikhan merged commit 67c0ebd into main Nov 20, 2025
4 checks passed
@pelikhan
pelikhan deleted the copilot/fix-zizmor-warning-activation-job branch November 20, 2025 16:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR eliminates 72 false-positive zizmor obfuscation warnings by replacing unusual ${{ '' }} expression syntax with plain empty string literals "" in activation job outputs. The change is purely cosmetic from a functional perspective but significantly improves security scanning signal-to-noise ratio.

  • Modified compiler to emit "" instead of ${{ '' }} for default empty output values
  • Recompiled all 68 workflows with the updated pattern
  • No functional changes to workflow behavior

Reviewed Changes

Copilot reviewed 68 out of 68 changed files in this pull request and generated no comments.

File Description
pkg/workflow/compiler_jobs.go Updated default output value generation from ${{ '' }} expression to "" literal, with updated comment explaining the rationale
.github/workflows/*.lock.yml (68 files) Recompiled workflow files with updated activation job output syntax, changing comment_id: ${{ '' }} and comment_repo: ${{ '' }} to comment_id: "" and comment_repo: ""

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[task] Fix zizmor obfuscation warning by using plain empty strings in activation job outputs

3 participants