Skip to content

Comments

Add --force-refresh-action-pins flag to compile command with automatic SHA validation#10396

Merged
pelikhan merged 6 commits intomainfrom
copilot/add-compile-cli-flag
Jan 17, 2026
Merged

Add --force-refresh-action-pins flag to compile command with automatic SHA validation#10396
pelikhan merged 6 commits intomainfrom
copilot/add-compile-cli-flag

Conversation

Copy link
Contributor

Copilot AI commented Jan 17, 2026

Adds a --force-refresh-action-pins flag to clear the action cache and reset the embedded action pins list, forcing dynamic resolution of all action SHAs from GitHub API. The flag automatically enables SHA validation to verify all resolved SHAs point to valid commits.

Changes:

  • CLI flag: Added --force-refresh-action-pins to compile command
  • Cache clearing: Modified getSharedActionResolver() to skip loading .github/aw/actions-lock.json when flag is set
  • Embedded pins reset: Added resetActionPinsFile() to clear pkg/workflow/data/action_pins.json to empty structure
  • Config wiring: Added ForceRefreshActionPins field to CompileConfig and Compiler structs
  • Automatic SHA validation: Modified compileSpecificFiles() and compileAllFilesInDirectory() to automatically enable action SHA validation when the flag is used, ensuring all resolved SHAs are validated by resolving them against the GitHub API

Usage:

# Clear cache and resolve all action SHAs fresh from GitHub API
gh aw compile --force-refresh-action-pins

# Result: pkg/workflow/data/action_pins.json becomes {"entries": {}}
# All action references resolve dynamically, new cache saved to .github/aw/actions-lock.json
# SHA validation runs automatically, reporting warnings for any outdated or invalid SHAs

Testing:

  • Verifies cache is not loaded when flag is enabled
  • Verifies action_pins.json is reset to empty structure
  • Verifies graceful handling when file doesn't exist
  • Verifies SHA validation is automatically enabled when flag is used
Original prompt

Add 'compile' cli flag to --force-refresh-action-pins and reset the action-pins list.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 17, 2026 01:27
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Contributor

@copilot validate all sha used in the workflows by resolving the commit

Copilot AI changed the title [WIP] Add compile CLI flag to force refresh action pins Add --force-refresh-action-pins flag to compile command Jan 17, 2026
Copilot AI requested a review from pelikhan January 17, 2026 01:49
…-action-pins

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 17, 2026

@copilot validate all sha used in the workflows by resolving the commit

Done! When --force-refresh-action-pins is used, action SHA validation is now automatically enabled. This means all resolved SHAs are validated by resolving them against the GitHub API to ensure they point to valid commits.

The validation logic:

  • Extracts all action SHAs from the compiled lock files
  • Resolves each SHA's version tag via GitHub API
  • Compares current SHA with latest available SHA
  • Reports warnings for any outdated or invalid SHAs

Commit: ffd20e2

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add --force-refresh-action-pins flag to compile command Add --force-refresh-action-pins flag to compile command with automatic SHA validation Jan 17, 2026
@pelikhan pelikhan marked this pull request as ready for review January 17, 2026 02:00
@pelikhan pelikhan merged commit c71c2bd into main Jan 17, 2026
@pelikhan pelikhan deleted the copilot/add-compile-cli-flag branch January 17, 2026 02:01
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