Skip to content

Require immutable gh-aw action-mode references - #60227

Closed
mnkiefer with Copilot wants to merge 4 commits into
mainfrom
copilot/implement-source-level-fixes
Closed

mnkiefer with Copilot wants to merge 4 commits into
mainfrom
copilot/implement-source-level-fixes

Conversation

Copilot AI commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Regenerated github/gh-aw-actions workflows could emit mutable action references, triggering zizmor findings such as unpinned-uses and stale SHA/version comments. Action mode should only generate secure-by-construction uses: references.

  • Action-mode pinning

    • Require github/gh-aw-actions/* references to resolve to full commit SHAs.
    • Reject unresolved refs instead of falling back to mutable tags.
    • Reject resolver results that are not full SHAs.
  • Strict setup-action resolution

    • Apply the same fail-closed behavior to github/gh-aw-actions/setup.
    • Use strict pin resolution to avoid compatible/stale embedded-pin fallback.
  • Tests and generated pin data

    • Added coverage for full-SHA acceptance, short-SHA rejection, unresolved fallback rejection, and cache-backed action-mode compilation.
    • Removed stale generated github/gh-aw-actions/setup pin data synced from the canonical action lock.

Example generated reference:

uses: github/gh-aw-actions/setup@0123456789abcdef0123456789abcdef01234567 # v1.2.3

Copilot AI linked an issue Sep 11, 2026 that may be closed by this pull request
Copilot AI and others added 3 commits September 11, 2026 08:16
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix source-level issues in github/gh-aw workflows Require immutable gh-aw action-mode references Sep 11, 2026
Copilot AI requested a review from mnkiefer September 11, 2026 08:40
@mnkiefer
mnkiefer marked this pull request as ready for review September 11, 2026 08:41
Copilot AI balanced review requested due to automatic review settings September 11, 2026 08:41
@mnkiefer mnkiefer closed this Sep 11, 2026

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.

🟡 Changes recommended

Unresolved setup pins can still produce malformed or fallback workflows, and resolution failures may be omitted from manifests.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Enforces immutable full-SHA references for github/gh-aw-actions/*, addressing #60226.

Changes:

  • Adds strict action-mode pin resolution and rejects mutable/short references.
  • Expands SHA-resolution tests and cache-backed compilation coverage.
  • Regenerates release workflow metadata and removes the stale setup pin.
File summaries
File Description
pkg/workflow/action_reference.go Implements strict action-mode reference resolution.
pkg/workflow/action_pins.go Adds strict pin-resolution helper.
pkg/workflow/action_reference_test.go Tests full-SHA acceptance and rejection paths.
pkg/workflow/compiler_custom_actions_test.go Tests cache-backed action-mode compilation.
pkg/workflow/compiler_yaml_test.go Updates release metadata fixture.
.github/aw/actions-lock.json Removes stale setup pin data.
.github/workflows/release.lock.yml Regenerates the release workflow.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +79 to +80
actionRefLog.Printf("Action mode: refusing to emit mutable external actions repo reference: %s", remoteRef)
return ""
Comment on lines +361 to +362
pinData := *data
pinData.StrictMode = true
name: "release build should include version",
isRelease: true,
version: "v0.1.2",
version: "0123456789abcdef0123456789abcdef01234567",
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.

Fix the compiler and workflow sources

3 participants