2024-03-20 20:36:03 +08:00
|
|
|
name: 'Setup Node.js env'
|
|
|
|
description:
|
|
|
|
'Setup a Node.js environment by downloading and adding it to the PATH.'
|
|
|
|
author: 'walker-sheng'
|
2024-03-20 14:49:06 +08:00
|
|
|
|
|
|
|
# Add your action's branding here. This will appear on the GitHub Marketplace.
|
|
|
|
branding:
|
|
|
|
icon: 'heart'
|
|
|
|
color: 'red'
|
|
|
|
|
|
|
|
# Define your inputs here.
|
|
|
|
inputs:
|
2024-03-20 20:36:03 +08:00
|
|
|
version:
|
|
|
|
description:
|
|
|
|
'Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0.'
|
|
|
|
cache:
|
|
|
|
description:
|
|
|
|
'Used to specify a package manager for caching in the default directory.
|
|
|
|
Supported values: npm, yarn, pnpm.'
|
2024-03-20 14:49:06 +08:00
|
|
|
required: true
|
2024-03-20 20:36:03 +08:00
|
|
|
default: 'npm'
|
|
|
|
cache-dependency-path:
|
|
|
|
description:
|
|
|
|
'Used to specify the path to a dependency file: package-lock.json,
|
|
|
|
yarn.lock, etc. Supports wildcards or a list of file names for caching
|
|
|
|
multiple dependencies.'
|
|
|
|
required: true
|
|
|
|
default: 'package-lock.json'
|
2024-03-20 14:49:06 +08:00
|
|
|
|
|
|
|
# Define your outputs here.
|
|
|
|
outputs:
|
2024-03-20 20:36:03 +08:00
|
|
|
cache-hit:
|
|
|
|
description: 'A boolean value to indicate if a cache was hit.'
|
|
|
|
version:
|
|
|
|
description: 'The installed node version.'
|
2024-03-20 14:49:06 +08:00
|
|
|
|
|
|
|
runs:
|
|
|
|
using: node20
|
|
|
|
main: dist/index.js
|
2024-03-20 20:36:03 +08:00
|
|
|
post: 'dist/cache-save/index.js'
|
|
|
|
post-if: success()
|