Skip to content

Validate live container digests during gh aw update - #47985

Closed
pelikhan with Copilot wants to merge 3 commits into
mainfrom
copilot/add-container-pin-entry-resolve-digest
Closed

Validate live container digests during gh aw update#47985
pelikhan with Copilot wants to merge 3 commits into
mainfrom
copilot/add-container-pin-entry-resolve-digest

Conversation

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

gh aw update already verified action SHAs after rewriting actions-lock.json, but container pins were only checked structurally. That allowed newly added or stale container entries to survive update even when their stored digest no longer matched the current image.

  • What changed

    • Extended post-update lock validation to re-resolve container image digests, alongside existing action SHA verification.
    • Added a container-specific resolver to the validation path so update can compare containers[*].digest against the live registry value.
  • Behavior change

    • A container pin now fails update validation when:
      • the entry is malformed, or
      • the image resolves successfully and its current digest differs from the stored digest.
    • Structural-only validation paths continue to skip live registry checks.
  • Regression coverage

    • Added cases for:
      • matching live digest → validation passes
      • resolver/network failure → validation is skipped as non-fatal
      • digest mismatch → validation reports the container pin as invalid
resolvedDigest, err := r.resolveContainerDigest(ctx, image)
if err != nil {
	updateValidationLog.Printf("container pin %q: skipping digest check (resolution failed): %v", image, err)
} else if !strings.EqualFold(resolvedDigest, pin.Digest) {
	issues = append(issues, fmt.Sprintf(
		"container pin %q digest mismatch: image resolves to %q but stored digest is %q",
		image, resolvedDigest, pin.Digest,
	))
}

Copilot AI and others added 2 commits July 25, 2026 11:19
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Validate container digests during gh aw update Validate live container digests during gh aw update Jul 25, 2026
Copilot AI requested a review from pelikhan July 25, 2026 11:30
@pelikhan pelikhan closed this Jul 25, 2026
@github-actions
github-actions Bot deleted the copilot/add-container-pin-entry-resolve-digest branch August 2, 2026 03:00
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.

2 participants