github-action-readme-generator 1.12.8 → 1.12.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/bin/index.js +668 -519
- package/dist/mjs/index.d.ts +2 -3
- package/dist/mjs/index.js +28 -12
- package/package.json +4 -4
package/dist/mjs/index.d.ts
CHANGED
package/dist/mjs/index.js
CHANGED
|
@@ -717,14 +717,15 @@ function getCurrentVersionString(inputs) {
|
|
|
717
717
|
const actionDir = path$1.dirname(inputs.action.path);
|
|
718
718
|
log.debug(`version source: ${versionSource}`);
|
|
719
719
|
let detectedVersion;
|
|
720
|
-
if (versionSource === "explicit")
|
|
721
|
-
|
|
722
|
-
|
|
720
|
+
if (versionSource === "explicit") {
|
|
721
|
+
if (override && override.length > 0) {
|
|
722
|
+
detectedVersion = override;
|
|
723
|
+
log.debug(`using explicit version override: ${detectedVersion}`);
|
|
724
|
+
} else {
|
|
725
|
+
log.debug("explicit mode but no version_override set, falling back to 0.0.0");
|
|
726
|
+
detectedVersion = "0.0.0";
|
|
727
|
+
}
|
|
723
728
|
} else {
|
|
724
|
-
log.debug("explicit mode but no version_override set, falling back to 0.0.0");
|
|
725
|
-
detectedVersion = "0.0.0";
|
|
726
|
-
}
|
|
727
|
-
else {
|
|
728
729
|
switch (versionSource) {
|
|
729
730
|
case "git-branch":
|
|
730
731
|
detectedVersion = getVersionFromGitBranch(actionDir, log);
|
|
@@ -1489,10 +1490,12 @@ function loadConfig(log, providedConfig, configFilePath) {
|
|
|
1489
1490
|
const config = providedConfig ?? new Provider();
|
|
1490
1491
|
if (process.env.GITHUB_ACTION === "true") log.info("Running in GitHub action");
|
|
1491
1492
|
config.argv(argvOptions);
|
|
1492
|
-
if (configFilePath)
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1493
|
+
if (configFilePath) {
|
|
1494
|
+
if (fs.existsSync(configFilePath)) {
|
|
1495
|
+
log.info(`Config file found: ${configFilePath}`);
|
|
1496
|
+
config.file(configFilePath);
|
|
1497
|
+
} else log.debug(`Config file not found: ${configFilePath}`);
|
|
1498
|
+
}
|
|
1496
1499
|
config.env({
|
|
1497
1500
|
lowerCase: true,
|
|
1498
1501
|
parseValues: true,
|
|
@@ -2229,6 +2232,13 @@ function updateTitle(sectionToken, inputs) {
|
|
|
2229
2232
|
}
|
|
2230
2233
|
//#endregion
|
|
2231
2234
|
//#region src/sections/update-usage.ts
|
|
2235
|
+
/**
|
|
2236
|
+
* Renders the `usage` section: a fenced workflow snippet naming every action input,
|
|
2237
|
+
* each preceded by its description and default as YAML comments.
|
|
2238
|
+
* @param {ReadmeSection} sectionToken - The README marker pair to write the section into.
|
|
2239
|
+
* @param {Inputs} inputs - The parsed action metadata and the README editor to write with.
|
|
2240
|
+
* @returns {Promise<Record<string, string>>} The rendered section, keyed by its section token.
|
|
2241
|
+
*/
|
|
2232
2242
|
async function updateUsage(sectionToken, inputs) {
|
|
2233
2243
|
const log = new LogTask(sectionToken);
|
|
2234
2244
|
log.start();
|
|
@@ -2238,6 +2248,8 @@ async function updateUsage(sectionToken, inputs) {
|
|
|
2238
2248
|
log.info(`Version string: ${versionString}`);
|
|
2239
2249
|
const actionReference = `${actionName}@${versionString}`;
|
|
2240
2250
|
const indent = " # ";
|
|
2251
|
+
const defaultLabel = "Default: ";
|
|
2252
|
+
const defaultHang = " ".repeat(9);
|
|
2241
2253
|
const content = [];
|
|
2242
2254
|
content.push("```yaml", `- uses: ${actionReference}`, " with:");
|
|
2243
2255
|
const inp = inputs.action.inputs;
|
|
@@ -2264,7 +2276,11 @@ async function updateUsage(sectionToken, inputs) {
|
|
|
2264
2276
|
if (input !== void 0) {
|
|
2265
2277
|
if (!firstInput) content.push("");
|
|
2266
2278
|
content.push(...descriptions[key]);
|
|
2267
|
-
if (input.default !== void 0)
|
|
2279
|
+
if (input.default !== void 0) {
|
|
2280
|
+
const [firstLine, ...rest] = `${input.default}`.split(/\r\n|\n|\r/);
|
|
2281
|
+
content.push(`${indent}${defaultLabel}${firstLine}`.trimEnd());
|
|
2282
|
+
for (const line of rest) content.push(`${indent}${defaultHang}${line}`.trimEnd());
|
|
2283
|
+
}
|
|
2268
2284
|
content.push(` ${key}: ''`);
|
|
2269
2285
|
firstInput = false;
|
|
2270
2286
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "github-action-readme-generator",
|
|
3
3
|
"displayName": "bitflight-devops/github-action-readme-generator",
|
|
4
|
-
"version": "1.12.
|
|
4
|
+
"version": "1.12.9",
|
|
5
5
|
"description": "The docs generator for GitHub Actions. Auto-syncs action.yml to README.md with 8 sections: inputs, outputs, usage, badges, branding & more. Works as CLI or GitHub Action.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"github-actions",
|
|
@@ -149,11 +149,11 @@
|
|
|
149
149
|
"@commitlint/prompt": "^21.0.1",
|
|
150
150
|
"@semantic-release/changelog": "^7.0.0",
|
|
151
151
|
"@semantic-release/exec": "^7.1.0",
|
|
152
|
-
"@semantic-release/git": "^
|
|
152
|
+
"@semantic-release/git": "^11.0.1",
|
|
153
153
|
"@tsconfig/node24": "^24.0.4",
|
|
154
154
|
"@types/nconf": "^0.10.5",
|
|
155
155
|
"@types/node": "^26.1.1",
|
|
156
|
-
"@vitest/coverage-v8": "4.1.
|
|
156
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
157
157
|
"@voidzero-dev/vite-plus-core": "0.2.8",
|
|
158
158
|
"commitizen": "^4.3.1",
|
|
159
159
|
"conventional-commits": "^1.6.0",
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
"semantic-release": "^25.0.2",
|
|
169
169
|
"types-package-json": "^2.0.39",
|
|
170
170
|
"typescript": "7.0.2",
|
|
171
|
-
"vite-plus": "0.
|
|
171
|
+
"vite-plus": "0.3.1"
|
|
172
172
|
},
|
|
173
173
|
"engines": {
|
|
174
174
|
"node": ">=24.19.0 <30.0.0",
|