Skip to content

Replace uuid with crypto.randomUUID()#1378

Merged
HarithaVattikuti merged 4 commits intoactions:mainfrom
trivikr:remove-uuid
Feb 26, 2026
Merged

Replace uuid with crypto.randomUUID()#1378
HarithaVattikuti merged 4 commits intoactions:mainfrom
trivikr:remove-uuid

Conversation

@trivikr
Copy link
Contributor

@trivikr trivikr commented Sep 24, 2025

Description:

Related issue:
Fixes: #1377

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@trivikr trivikr requested a review from a team as a code owner September 24, 2025 00:57
Copilot AI review requested due to automatic review settings September 24, 2025 00:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Replaces the uuid npm package dependency with Node.js's built-in crypto.randomUUID() method to generate unique identifiers for temporary download folders.

  • Removes the uuid package dependency from package.json
  • Updates the temporary folder naming logic to use the native crypto API instead of the external uuid library

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/distributions/base-distribution.ts Replaces uuid import and uuidv4() call with crypto.randomUUID()
package.json Removes uuid dependency from the dependencies list

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


// Create temporary folder to download to
const tempDownloadFolder = `temp_${uuidv4()}`;
const tempDownloadFolder = `temp_${crypto.randomUUID()}`;
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The crypto.randomUUID() method requires Node.js 14.17.0+ or 16.0.0+. Consider adding a runtime check or documenting the minimum Node.js version requirement to ensure compatibility.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's specified in

"engines": {
"node": ">=24.0.0"
},

@gowridurgad
Copy link
Contributor

Hi @trivikr, thank you for submitting the PR. Could you please resolve the check failures and run licensed status and npm run build commands to fix the failing checks related to licensed and dist.

@trivikr
Copy link
Contributor Author

trivikr commented Oct 8, 2025

run licensed status

Done

$ licensed status   
Checking cached dependency records for setup-node
......................................................................................F.....
Errors:
* setup-node.npm.uuid
  version: 8.3.2, filename: /Users/trivikram/workspace/setup-node/.licenses/npm/uuid.dep.yml, license: , allowed: false
    - cached dependency record not found


92 dependencies checked, 1 errors found.

Licensed found errors during source enumeration.  Please see https://github.com/github/licensed/tree/master/docs/commands/status.md#status-errors-and-resolutions for possible resolutions.

$ licensed cache 
Caching dependency records for setup-node
  npm
    Using @actions/cache (4.0.3)
    Using @actions/core (1.11.1)
...
    Using xml2js (0.5.0)
    Using xmlbuilder (11.0.1)
  * 92 npm dependencies

Commit ee2d148 (#1378)

@trivikr
Copy link
Contributor Author

trivikr commented Oct 8, 2025

The files in dist folders were updated in 7944727 (#1378)

@trivikr
Copy link
Contributor Author

trivikr commented Oct 8, 2025

The issue in yarn 1 cache test seems to be with availability

error Error: https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.2.0.tgz: Request failed "502 Bad Gateway"
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
    at ResponseError.ExtendableBuiltin (/Users/runner/.yarn/lib/cli.js:696:66)
    at new ResponseError (/Users/runner/.yarn/lib/cli.js:802:124)

https://github.com/actions/setup-node/actions/runs/18350090223/job/52267623041

I believe CI should be successful, once it's approved to run by one of the maintainers.

gowridurgad
gowridurgad previously approved these changes Oct 9, 2025
@gowridurgad
Copy link
Contributor

Hi @trivikr, There are merge conflicts in this PR. Could you please resolve them so we can proceed further?

@trivikr
Copy link
Contributor Author

trivikr commented Jan 31, 2026

Could you please resolve them so we can proceed further?

Done.

@HarithaVattikuti HarithaVattikuti merged commit c882bff into actions:main Feb 26, 2026
225 of 228 checks passed
@trivikr trivikr deleted the remove-uuid branch February 26, 2026 19:38
mergify bot added a commit to ArcadeData/arcadedb-usecases that referenced this pull request Mar 6, 2026
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.4.0 to 6.3.0.
Release notes

*Sourced from [actions/setup-node's releases](https://github.com/actions/setup-node/releases).*

> v6.3.0
> ------
>
> What's Changed
> --------------
>
> ### Enhancements:
>
> * Support parsing `devEngines` field by [`@​susnux`](https://github.com/susnux) in [actions/setup-node#1283](https://redirect.github.com/actions/setup-node/pull/1283)
>
> > When using node-version-file: package.json, setup-node now prefers devEngines.runtime over engines.node.
>
> ### Dependency updates:
>
> * Fix npm audit issues by [`@​gowridurgad`](https://github.com/gowridurgad) in [actions/setup-node#1491](https://redirect.github.com/actions/setup-node/pull/1491)
> * Replace uuid with crypto.randomUUID() by [`@​trivikr`](https://github.com/trivikr) in [actions/setup-node#1378](https://redirect.github.com/actions/setup-node/pull/1378)
> * Upgrade minimatch from 3.1.2 to 3.1.5 by [`@​dependabot`](https://github.com/dependabot) in [actions/setup-node#1498](https://redirect.github.com/actions/setup-node/pull/1498)
>
> ### Bug fixes:
>
> * Remove hardcoded bearer for mirror-url [`@​marco-ippolito`](https://github.com/marco-ippolito) in [actions/setup-node#1467](https://redirect.github.com/actions/setup-node/pull/1467)
> * Scope test lockfiles by package manager and update cache tests by [`@​gowridurgad`](https://github.com/gowridurgad) in [actions/setup-node#1495](https://redirect.github.com/actions/setup-node/pull/1495)
>
> New Contributors
> ----------------
>
> * [`@​susnux`](https://github.com/susnux) made their first contribution in [actions/setup-node#1283](https://redirect.github.com/actions/setup-node/pull/1283)
>
> **Full Changelog**: <actions/setup-node@v6...v6.3.0>
>
> v6.2.0
> ------
>
> What's Changed
> --------------
>
> ### Documentation
>
> * Documentation update related to absence of Lockfile by [`@​mahabaleshwars`](https://github.com/mahabaleshwars) in [actions/setup-node#1454](https://redirect.github.com/actions/setup-node/pull/1454)
> * Correct mirror option typos by [`@​MikeMcC399`](https://github.com/MikeMcC399) in [actions/setup-node#1442](https://redirect.github.com/actions/setup-node/pull/1442)
> * Readme update on checkout version v6 by [`@​deining`](https://github.com/deining) in [actions/setup-node#1446](https://redirect.github.com/actions/setup-node/pull/1446)
> * Readme typo fixes [`@​munyari`](https://github.com/munyari) in [actions/setup-node#1226](https://redirect.github.com/actions/setup-node/pull/1226)
> * Advanced document update on checkout version v6 by [`@​aparnajyothi-y`](https://github.com/aparnajyothi-y) in [actions/setup-node#1468](https://redirect.github.com/actions/setup-node/pull/1468)
>
> ### Dependency updates:
>
> * Upgrade `@​actions/cache` to v5.0.1 by [`@​salmanmkc`](https://github.com/salmanmkc) in [actions/setup-node#1449](https://redirect.github.com/actions/setup-node/pull/1449)
>
> New Contributors
> ----------------
>
> * [`@​mahabaleshwars`](https://github.com/mahabaleshwars) made their first contribution in [actions/setup-node#1454](https://redirect.github.com/actions/setup-node/pull/1454)
> * [`@​MikeMcC399`](https://github.com/MikeMcC399) made their first contribution in [actions/setup-node#1442](https://redirect.github.com/actions/setup-node/pull/1442)
> * [`@​deining`](https://github.com/deining) made their first contribution in [actions/setup-node#1446](https://redirect.github.com/actions/setup-node/pull/1446)
> * [`@​munyari`](https://github.com/munyari) made their first contribution in [actions/setup-node#1226](https://redirect.github.com/actions/setup-node/pull/1226)
>
> **Full Changelog**: <actions/setup-node@v6...v6.2.0>
>
> v6.1.0
> ------
>
> What's Changed
> --------------
>
> ### Enhancement:
>
> * Remove always-auth configuration handling by [`@​priyagupta108`](https://github.com/priyagupta108) in [actions/setup-node#1436](https://redirect.github.com/actions/setup-node/pull/1436)
>
> ### Dependency updates:
>
> * Upgrade `@​actions/cache` from 4.0.3 to 4.1.0 by [`@​dependabot`](https://github.com/dependabot)[bot] in [actions/setup-node#1384](https://redirect.github.com/actions/setup-node/pull/1384)
> * Upgrade actions/checkout from 5 to 6 by [`@​dependabot`](https://github.com/dependabot)[bot] in [actions/setup-node#1439](https://redirect.github.com/actions/setup-node/pull/1439)

... (truncated)


Commits

* [`53b8394`](actions/setup-node@53b8394) Bump minimatch from 3.1.2 to 3.1.5 ([#1498](https://redirect.github.com/actions/setup-node/issues/1498))
* [`54045ab`](actions/setup-node@54045ab) Scope test lockfiles by package manager and update cache tests ([#1495](https://redirect.github.com/actions/setup-node/issues/1495))
* [`c882bff`](actions/setup-node@c882bff) Replace uuid with crypto.randomUUID() ([#1378](https://redirect.github.com/actions/setup-node/issues/1378))
* [`774c1d6`](actions/setup-node@774c1d6) feat(node-version-file): support parsing `devEngines` field ([#1283](https://redirect.github.com/actions/setup-node/issues/1283))
* [`efcb663`](actions/setup-node@efcb663) fix: remove hardcoded bearer ([#1467](https://redirect.github.com/actions/setup-node/issues/1467))
* [`d02c89d`](actions/setup-node@d02c89d) Fix npm audit issues ([#1491](https://redirect.github.com/actions/setup-node/issues/1491))
* [`6044e13`](actions/setup-node@6044e13) Docs: bump actions/checkout from v5 to v6 ([#1468](https://redirect.github.com/actions/setup-node/issues/1468))
* [`8e49463`](actions/setup-node@8e49463) Fix README typo ([#1226](https://redirect.github.com/actions/setup-node/issues/1226))
* [`621ac41`](actions/setup-node@621ac41) README.md: bump to latest released checkout version v6 ([#1446](https://redirect.github.com/actions/setup-node/issues/1446))
* [`2951748`](actions/setup-node@2951748) Bump `@​actions/cache` to v5.0.1 ([#1449](https://redirect.github.com/actions/setup-node/issues/1449))
* Additional commits viewable in [compare view](actions/setup-node@49933ea...53b8394)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=actions/setup-node&package-manager=github\_actions&previous-version=4.4.0&new-version=6.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
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.

Replace uuid with crypto.randomUUID()

5 participants