Skip to content

Commit dcc9184

Browse files
committed
Generate documentation from actions.yml
Right now the documentation of valid inputs (and outputs) seems to be manually maintained inside the `README.md` with a reference to the `actions.yml` file. Since this can be rather tedious to maintain this commit now uses [github-actions-docs][1] to automatically generate documentation. [1]: https://www.npmjs.com/package/github-action-docs
1 parent 8026329 commit dcc9184

File tree

5 files changed

+158
-90
lines changed

5 files changed

+158
-90
lines changed

README.md

+28-62
Original file line numberDiff line numberDiff line change
@@ -16,68 +16,34 @@ This action provides the following functionality for GitHub Actions users:
1616

1717
See [action.yml](action.yml)
1818

19-
<!-- start usage -->
20-
```yaml
21-
- uses: actions/setup-node@v4
22-
with:
23-
# Version Spec of the version to use in SemVer notation.
24-
# It also admits such aliases as lts/*, latest, nightly and canary builds
25-
# Examples: 12.x, 10.15.1, >=10.15.0, lts/Hydrogen, 16-nightly, latest, node
26-
node-version: ''
27-
28-
# File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions.
29-
# If node-version and node-version-file are both provided the action will use version from node-version.
30-
node-version-file: ''
31-
32-
# Set this option if you want the action to check for the latest available version
33-
# that satisfies the version spec.
34-
# It will only get affect for lts Nodejs versions (12.x, >=10.15.0, lts/Hydrogen).
35-
# Default: false
36-
check-latest: false
37-
38-
# Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default.
39-
# Default: ''. The action use system architecture by default
40-
architecture: ''
41-
42-
# Used to pull node distributions from https://github.com/actions/node-versions.
43-
# Since there's a default, this is typically not supplied by the user.
44-
# When running this action on github.com, the default value is sufficient.
45-
# When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.
46-
#
47-
# We recommend using a service account with the least permissions necessary. Also
48-
# when generating a new PAT, select the least scopes necessary.
49-
#
50-
# [Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
51-
#
52-
# Default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
53-
token: ''
54-
55-
# Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm.
56-
# Package manager should be pre-installed
57-
# Default: ''
58-
cache: ''
59-
60-
# Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc.
61-
# It will generate hash from the target file for primary key. It works only If cache is specified.
62-
# Supports wildcards or a list of file names for caching multiple dependencies.
63-
# Default: ''
64-
cache-dependency-path: ''
65-
66-
# Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file,
67-
# and set up auth to read in from env.NODE_AUTH_TOKEN.
68-
# Default: ''
69-
registry-url: ''
70-
71-
# Optional scope for authenticating against scoped registries.
72-
# Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/).
73-
# Default: ''
74-
scope: ''
75-
76-
# Set always-auth option in npmrc file.
77-
# Default: ''
78-
always-auth: ''
79-
```
80-
<!-- end usage -->
19+
<!-- markdownlint-capture -->
20+
<!-- markdownlint-disable -->
21+
<!-- prettier-ignore-start -->
22+
<!-- BEGIN_GITHUB_ACTION_DOCS -->
23+
## Inputs
24+
25+
| Name | Description | Default | Required |
26+
|------|-------------|---------|:--------:|
27+
| <a name="input_always_auth"></a> [always-auth](#input\_always\_auth) | Set always-auth in npmrc. | `false` | no |
28+
| <a name="input_architecture"></a> [architecture](#input\_architecture) | Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default. | | no |
29+
| <a name="input_cache"></a> [cache](#input\_cache) | Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm. | | no |
30+
| <a name="input_cache_dependency_path"></a> [cache-dependency-path](#input\_cache\_dependency\_path) | 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. | | no |
31+
| <a name="input_check_latest"></a> [check-latest](#input\_check\_latest) | Set this option if you want the action to check for the latest available version that satisfies the version spec. | | no |
32+
| <a name="input_node_version"></a> [node-version](#input\_node\_version) | Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0. | | no |
33+
| <a name="input_node_version_file"></a> [node-version-file](#input\_node\_version\_file) | File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions. | | no |
34+
| <a name="input_registry_url"></a> [registry-url](#input\_registry\_url) | Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN. | | no |
35+
| <a name="input_scope"></a> [scope](#input\_scope) | Optional scope for authenticating against scoped registries. Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/). | | no |
36+
| <a name="input_token"></a> [token](#input\_token) | Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting. | `${{ github.server_url == 'https://github.com' && github.token || '' }}` | no |
37+
38+
## Outputs
39+
40+
| Name | Description |
41+
|------|-------------|
42+
| <a name="output_cache_hit"></a> [cache-hit](#output\_cache\_hit) | A boolean value to indicate if a cache was hit. |
43+
| <a name="output_node_version"></a> [node-version](#output\_node\_version) | The installed node version. |
44+
<!-- END_GITHUB_ACTION_DOCS -->
45+
<!-- prettier-ignore-end -->
46+
<!-- markdownlint-restore -->
8147

8248
**Basic:**
8349

dist/cache-save/index.js

+42-12
Original file line numberDiff line numberDiff line change
@@ -59691,7 +59691,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
5969159691
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
5969259692
PERFORMANCE OF THIS SOFTWARE.
5969359693
***************************************************************************** */
59694-
/* global global, define, Symbol, Reflect, Promise, SuppressedError */
59694+
/* global global, define, Symbol, Reflect, Promise, SuppressedError, Iterator */
5969559695
var __extends;
5969659696
var __assign;
5969759697
var __rest;
@@ -59723,6 +59723,7 @@ var __classPrivateFieldIn;
5972359723
var __createBinding;
5972459724
var __addDisposableResource;
5972559725
var __disposeResources;
59726+
var __rewriteRelativeImportExtension;
5972659727
(function (factory) {
5972759728
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
5972859729
if (typeof define === "function" && define.amd) {
@@ -59850,8 +59851,8 @@ var __disposeResources;
5985059851
};
5985159852

5985259853
__generator = function (thisArg, body) {
59853-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
59854-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
59854+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
59855+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
5985559856
function verb(n) { return function (v) { return step([n, v]); }; }
5985659857
function step(op) {
5985759858
if (f) throw new TypeError("Generator is already executing.");
@@ -59955,10 +59956,11 @@ var __disposeResources;
5995559956
__asyncGenerator = function (thisArg, _arguments, generator) {
5995659957
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
5995759958
var g = generator.apply(thisArg, _arguments || []), i, q = [];
59958-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
59959-
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
59959+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
59960+
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
59961+
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
5996059962
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
59961-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
59963+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
5996259964
function fulfill(value) { resume("next", value); }
5996359965
function reject(value) { resume("throw", value); }
5996459966
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
@@ -59989,10 +59991,19 @@ var __disposeResources;
5998959991
o["default"] = v;
5999059992
};
5999159993

59994+
var ownKeys = function(o) {
59995+
ownKeys = Object.getOwnPropertyNames || function (o) {
59996+
var ar = [];
59997+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
59998+
return ar;
59999+
};
60000+
return ownKeys(o);
60001+
};
60002+
5999260003
__importStar = function (mod) {
5999360004
if (mod && mod.__esModule) return mod;
5999460005
var result = {};
59995-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
60006+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
5999660007
__setModuleDefault(result, mod);
5999760008
return result;
5999860009
};
@@ -60022,16 +60033,18 @@ var __disposeResources;
6002260033
__addDisposableResource = function (env, value, async) {
6002360034
if (value !== null && value !== void 0) {
6002460035
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
60025-
var dispose;
60036+
var dispose, inner;
6002660037
if (async) {
6002760038
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
6002860039
dispose = value[Symbol.asyncDispose];
6002960040
}
6003060041
if (dispose === void 0) {
6003160042
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
6003260043
dispose = value[Symbol.dispose];
60044+
if (async) inner = dispose;
6003360045
}
6003460046
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
60047+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
6003560048
env.stack.push({ value: value, dispose: dispose, async: async });
6003660049
}
6003760050
else if (async) {
@@ -60050,22 +60063,36 @@ var __disposeResources;
6005060063
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
6005160064
env.hasError = true;
6005260065
}
60066+
var r, s = 0;
6005360067
function next() {
60054-
while (env.stack.length) {
60055-
var rec = env.stack.pop();
60068+
while (r = env.stack.pop()) {
6005660069
try {
60057-
var result = rec.dispose && rec.dispose.call(rec.value);
60058-
if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
60070+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
60071+
if (r.dispose) {
60072+
var result = r.dispose.call(r.value);
60073+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
60074+
}
60075+
else s |= 1;
6005960076
}
6006060077
catch (e) {
6006160078
fail(e);
6006260079
}
6006360080
}
60081+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
6006460082
if (env.hasError) throw env.error;
6006560083
}
6006660084
return next();
6006760085
};
6006860086

60087+
__rewriteRelativeImportExtension = function (path, preserveJsx) {
60088+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
60089+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
60090+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
60091+
});
60092+
}
60093+
return path;
60094+
};
60095+
6006960096
exporter("__extends", __extends);
6007060097
exporter("__assign", __assign);
6007160098
exporter("__rest", __rest);
@@ -60097,8 +60124,11 @@ var __disposeResources;
6009760124
exporter("__classPrivateFieldIn", __classPrivateFieldIn);
6009860125
exporter("__addDisposableResource", __addDisposableResource);
6009960126
exporter("__disposeResources", __disposeResources);
60127+
exporter("__rewriteRelativeImportExtension", __rewriteRelativeImportExtension);
6010060128
});
6010160129

60130+
0 && (0);
60131+
6010260132

6010360133
/***/ }),
6010460134

0 commit comments

Comments
 (0)