Skip to content

feat: hawkscan-action v3 β€” version-gated binary download for hawk 6.0.0+#286

Merged
kcberg merged 6 commits into
mainfrom
kcberg/eng-599-hawkscan-action-v3
Jun 26, 2026
Merged

feat: hawkscan-action v3 β€” version-gated binary download for hawk 6.0.0+#286
kcberg merged 6 commits into
mainfrom
kcberg/eng-599-hawkscan-action-v3

Conversation

@kcberg

@kcberg kcberg commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Version-gates CLI download: hawk < 6.0.0 β†’ existing ZIP path (unchanged); hawk >= 6.0.0 β†’ platform-native binary (hawk/{version}/{platform}/hawk[.exe])
  • Adds _STACKHAWK_ACTION_VERSION / _STACKHAWK_ACTION_REPOSITORY scan metadata so the platform can measure action adoption ahead of the 6.0.0 cutover
  • Adds semver as a production dependency for the version gate
  • Trims the version API response to avoid trailing-newline issues in binary URLs
  • Uses spawn env option instead of mutating process.env for cleaner test isolation

How it works

getDownloadObject() in cli_utils.js now gates on semver.gte(version, '6.0.0'). Below that threshold the ZIP path is completely unchanged. At 6.0.0+, getBinaryDownloadObject() resolves the platform/arch to the binary URL and returns { isBinary: true }. setup.js branches on download.isBinary: single-file download β†’ temp dir β†’ chmod 755 (non-Windows) β†’ addPath.

The sourceURL action input strips its /cli suffix via binaryBaseUrl(), so dev builds (…/dev/hawk/cli) correctly resolve to …/dev/hawk/{version}/{platform}/hawk.

Test plan

  • All 37 existing tests pass (npm run all)
  • New test: getDownloadObject('6.0.0', …) returns isBinary: true with correct URL shape
  • Verify on a real GitHub Actions run with hawk 6.0.0 once Phase 2 binary assets are available in dev-local

Notes

  • This PR does not include the v3.0.0 version bump β€” see discussion in ENG-599 on timing
  • Part of ENG-599 / hawk binary distribution Phase 4

ship it

πŸ€– Generated with Claude Code

kcberg and others added 2 commits June 25, 2026 15:22
…etadata

FIRST_BINARY_VERSION=6.0.0. 5.x.x β†’ ZIP (unchanged). 6.0.0+ β†’ binary.
Action version forwarded as _STACKHAWK_ACTION_VERSION scan tag.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…tating process.env

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@kcberg
kcberg requested a review from a team as a code owner June 26, 2026 21:51
@linear-code

linear-code Bot commented Jun 26, 2026

Copy link
Copy Markdown

ENG-599

Comment thread src/hawk_process.js Dismissed
kcberg and others added 4 commits June 26, 2026 16:08
Prevents argument injection via the 'command' action input.
Only 'scan' and 'rescan' are valid values.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Allows 'validate config' and other hawk subcommands with args.
Covers: scan, rescan, validate (+ any sub-subcommands like 'validate config').

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Fixes CodeQL 'Workflow does not contain permissions' alerts on all jobs.
Minimum permissions: contents:read. Jobs posting code scanning results
(live-test, verbose-debug-test, ajax-test) also get security-events:write.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@kcberg
kcberg merged commit bedb10a into main Jun 26, 2026
13 checks passed
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.

3 participants