Skip to content

Action interface cleanup: deprecate inputs, add cache-hit output, fix extra-args#110

Merged
j178 merged 2 commits into
j178:mainfrom
shaanmajid:feat/action-interface-cleanup
Mar 18, 2026
Merged

Action interface cleanup: deprecate inputs, add cache-hit output, fix extra-args#110
j178 merged 2 commits into
j178:mainfrom
shaanmajid:feat/action-interface-cleanup

Conversation

@shaanmajid

@shaanmajid shaanmajid commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add deprecationMessage to extra_args and token inputs so GitHub renders deprecation warnings in the workflow UI
  • Change token default from ${{ github.token }} to '' to avoid unnecessary token injection
  • Add cache-hit output reporting whether the restored cache exactly matched the primary key
  • Fix extra-args: '' being impossible to express — the || fallback now relies on the YAML default rather than a hardcoded '--all-files'
  • Remove dead _token parameter from resolveVersion and token from the Inputs type

- 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
@shaanmajid shaanmajid force-pushed the feat/action-interface-cleanup branch from 25635ca to 0852fed Compare March 18, 2026 06:06
@j178 j178 added the enhancement New feature or request label Mar 18, 2026
@j178 j178 requested a review from Copilot March 18, 2026 06:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_args and token inputs via deprecationMessage, and stops passing/reading token at runtime.
  • Adds cache-hit output 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.

Comment thread src/inputs.ts
Comment on lines +6 to +11
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,

@shaanmajid shaanmajid Mar 18, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed that bullet from PR description :^)

Comment thread test/inputs.test.ts
@j178 j178 merged commit 7774ba8 into j178:main Mar 18, 2026
13 checks passed
@j178

j178 commented Mar 18, 2026

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants