Action interface cleanup: deprecate inputs, add cache-hit output, fix extra-args#110
Conversation
- Add deprecationMessage to extra_args and token inputs in action.yaml - Emit core.warning() when extra_args is used - Change token default from github.token to '' (no-op input) - Add cache-hit output from restorePrekCache result - Fix extra-args: '' being impossible to express (|| chain with YAML default) - Remove dead _token parameter from resolveVersion - Remove token from Inputs type - Export run() with isMainModule guard for testability
25635ca to
0852fed
Compare
There was a problem hiding this comment.
Pull request overview
Cleans up the GitHub Action interface by deprecating legacy inputs, removing the unused token plumbing, and adding a cache-hit output so workflows can detect exact cache hits.
Changes:
- Deprecates
extra_argsandtokeninputs viadeprecationMessage, and stops passing/readingtokenat runtime. - Adds
cache-hitoutput based on whether the restored cache key exactly matches the primary key. - Fixes
extra-args: ''handling by relying on the YAML default instead of a hardcoded fallback; updates/reshapes unit tests accordingly.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/metadata.test.ts | Adds metadata assertions for deprecated inputs and new output. |
| test/manifest.test.ts | Updates tests for resolveVersion signature change; removes getInputs tests moved elsewhere. |
| test/main.test.ts | Adds unit tests for cache-hit output behavior and install-only flow. |
| test/inputs.test.ts | Adds focused unit tests for input parsing/deprecation behavior and empty extra-args. |
| src/types.ts | Removes token from Inputs type. |
| src/manifest.ts | Removes unused _token parameter from resolveVersion. |
| src/main.ts | Exports run, removes token usage, sets cache-hit, and avoids auto-exec when imported. |
| src/inputs.ts | Adjusts extra-args fallback behavior; stops reading token. |
| src/cache.ts | Returns {matchedKey, primaryKey} from restore to support cache-hit. |
| dist/index.cjs | Updates bundled artifact to reflect source changes. |
| action.yaml | Adds deprecations, changes token default to empty, and introduces cache-hit output. |
| README.md | Documents token deprecation/default change and the new cache-hit output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const legacyExtraArgs = core.getInput('extra_args') | ||
| const modernExtraArgs = core.getInput('extra-args') | ||
| const showVerboseLogsInput = core.getInput('show-verbose-logs') | ||
|
|
||
| return { | ||
| extraArgs: core.getInput('extra_args') || core.getInput('extra-args') || '--all-files', | ||
| extraArgs: legacyExtraArgs || modernExtraArgs, |
There was a problem hiding this comment.
Ah I deliberately changed this, but forgot to update PR description.. GitHub's metadata syntax says that message is already logged as a warning when an input with deprecationMessage is used. Emitting core.warning() here will therefore produce a second warning for every workflow still on extra_args, which makes the UX noisier.
There was a problem hiding this comment.
Removed that bullet from PR description :^)
|
Thanks! |
Summary
deprecationMessagetoextra_argsandtokeninputs so GitHub renders deprecation warnings in the workflow UItokendefault from${{ github.token }}to''to avoid unnecessary token injectioncache-hitoutput reporting whether the restored cache exactly matched the primary keyextra-args: ''being impossible to express — the||fallback now relies on the YAML default rather than a hardcoded'--all-files'_tokenparameter fromresolveVersionandtokenfrom theInputstype