Modernize to node24/ESM, harden defaults, add tests and CI#7
Draft
Modernize to node24/ESM, harden defaults, add tests and CI#7
Conversation
Bumps the action runtime to node24 and converts source from CommonJS to ESM. Bumps uuid (3 -> 14) and @actions/core (1 -> 3); replaces the deprecated @zeit/ncc with @vercel/ncc; removes yarn in favour of npm. Hardening based on review: - Default UUID is now v4 (random) instead of v1 (timestamp-based) - namespace input validated with uuid.validate; clear error on bad input - error handler narrows unknown to string instead of assuming Error - pin runtime via engines.node and .nvmrc Adds an integration test suite using node:test that spawns the action with controlled env vars, plus a CI workflow that runs tests and verifies dist/ is in sync with source. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
uuid(3 → 14),@actions/core(1 → 3); swaps deprecated@zeit/nccfor@vercel/ncc; standardises on npm (dropsyarn.lock).namespaceinput is validated withuuid.validate(); bad input produces a clearsetFailedmessage instead of a rawTypeError.unknownproperly:error instanceof Error ? error.message : String(error).engines.nodeand.nvmrc.test/run.test.js— 4 integration tests usingnode:testthat spawn the action with controlledINPUT_*andGITHUB_OUTPUTenv vars..github/workflows/ci.yml— runs the tests and fails ifdist/is out of sync with source.Breaking change
Default UUID flavour changes from v1 → v4 when no
nameinput is supplied. Consumers relying on the timestamp-ordered v1 default will need to setname/namespaceexplicitly to get v5, or pin to a previous tag.Test plan
name: hello→ confirm a deterministic v5 UUIDname: hello, namespace: not-a-uuid→ confirm clean failure with the validation message🤖 Generated with Claude Code