github-action-readme-generator 1.12.3 → 1.12.5

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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.12.5](https://github.com/bitflight-devops/github-action-readme-generator/compare/v1.12.4...v1.12.5) (2026-08-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **versioning:** preserve parsed falsy branch refs ([#663](https://github.com/bitflight-devops/github-action-readme-generator/issues/663)) ([1bf6d0e](https://github.com/bitflight-devops/github-action-readme-generator/commit/1bf6d0e8d549e79823db0e242ef2fd3bb5ae9e9d))
7
+
8
+ ## [1.12.4](https://github.com/bitflight-devops/github-action-readme-generator/compare/v1.12.3...v1.12.4) (2026-08-15)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **branding:** generate SVG on first run ([#664](https://github.com/bitflight-devops/github-action-readme-generator/issues/664)) ([1e1910e](https://github.com/bitflight-devops/github-action-readme-generator/commit/1e1910ec9a3926487c5ae06efa89db99e79efc24))
14
+
1
15
  ## [1.12.3](https://github.com/bitflight-devops/github-action-readme-generator/compare/v1.12.2...v1.12.3) (2026-08-15)
2
16
 
3
17
 
package/README.md CHANGED
@@ -177,7 +177,7 @@ This configuration will automatically regenerate your README whenever `action.ym
177
177
  <!-- start usage -->
178
178
 
179
179
  ```yaml
180
- - uses: bitflight-devops/github-action-readme-generator@v1.12.2
180
+ - uses: bitflight-devops/github-action-readme-generator@v1.12.4
181
181
  with:
182
182
  # Description: The absolute or relative path to the `action.yml` file to read in
183
183
  # from.
package/dist/bin/index.js CHANGED
@@ -4,14 +4,14 @@ await(async()=>{let{dirname:e}=await import("path"),{fileURLToPath:i}=await impo
4
4
 
5
5
  import { createRequire } from "node:module";
6
6
  import * as fs$10 from "node:fs";
7
- import { accessSync, promises, readFileSync } from "node:fs";
7
+ import { accessSync, existsSync, promises, readFileSync } from "node:fs";
8
8
  import * as path$2 from "node:path";
9
9
  import path, { dirname, join } from "node:path";
10
10
  import * as os$10 from "os";
11
11
  import os, { EOL } from "os";
12
12
  import * as crypto$2 from "crypto";
13
13
  import * as fs$16 from "fs";
14
- import fs4, { constants, existsSync, promises as promises$1, readFileSync as readFileSync$1, realpathSync, statSync } from "fs";
14
+ import fs4, { constants, existsSync as existsSync$1, promises as promises$1, readFileSync as readFileSync$1, realpathSync, statSync } from "fs";
15
15
  import * as path$6 from "path";
16
16
  import path10, { dirname as dirname$1 } from "path";
17
17
  import * as events from "events";
@@ -17034,7 +17034,7 @@ var Context$1 = class {
17034
17034
  constructor() {
17035
17035
  var _a, _b, _c;
17036
17036
  this.payload = {};
17037
- if (process.env.GITHUB_EVENT_PATH) if (existsSync(process.env.GITHUB_EVENT_PATH)) this.payload = JSON.parse(readFileSync$1(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" }));
17037
+ if (process.env.GITHUB_EVENT_PATH) if (existsSync$1(process.env.GITHUB_EVENT_PATH)) this.payload = JSON.parse(readFileSync$1(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" }));
17038
17038
  else {
17039
17039
  const path = process.env.GITHUB_EVENT_PATH;
17040
17040
  process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${EOL}`);
@@ -42613,15 +42613,6 @@ const unicodeWordMatch = /(?:[\dA-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00
42613
42613
  //#endregion
42614
42614
  //#region src/helpers.ts
42615
42615
  /**
42616
- * Returns the input value if it is not empty, otherwise returns undefined.
42617
- * @param value - The input value to check.
42618
- * @returns The input value if it is not empty, otherwise undefined.
42619
- */
42620
- function undefinedOnEmpty(value) {
42621
- if (!value || value === "") return;
42622
- return value;
42623
- }
42624
- /**
42625
42616
  * Converts the given text to title case.
42626
42617
  * @param text - The text to convert.
42627
42618
  * @returns The text converted to title case.
@@ -42911,7 +42902,10 @@ function getCurrentVersionString(inputs) {
42911
42902
  versionString = detectedVersion ?? "0.0.0";
42912
42903
  const prefix = inputs.config.get("versioning:prefix") ?? "v";
42913
42904
  if (versionSource !== "git-branch" && versionSource !== "git-sha" && versionString && !versionString.startsWith(prefix)) versionString = `${prefix}${versionString}`;
42914
- } else versionString = undefinedOnEmpty(inputs.config.get("versioning:branch")) ?? "main";
42905
+ } else {
42906
+ const configuredBranch = inputs.config.get("versioning:branch");
42907
+ versionString = configuredBranch === void 0 || configuredBranch === "" ? "main" : String(configuredBranch);
42908
+ }
42915
42909
  log.debug(`version to use in generated example is ${versionString}`);
42916
42910
  return versionString;
42917
42911
  }
@@ -320995,7 +320989,7 @@ function generateImgMarkup(inputs, width = "15%") {
320995
320989
  log.info(`Generating action.yml branding image for ${iconName}`);
320996
320990
  const svg = inputs.config.get("image_generated");
320997
320991
  const hash = `${iconName}${brandColor}`;
320998
- if (svg && hash.localeCompare(svg) !== 0) {
320992
+ if (!svg || hash.localeCompare(svg) !== 0 || !existsSync(svgPath)) {
320999
320993
  generateSvgImage(svgPath, iconName, brandColor);
321000
320994
  inputs.config.set("image_generated", hash);
321001
320995
  }
@@ -321474,6 +321468,7 @@ var GHActionDocsConfig = class {
321474
321468
  title;
321475
321469
  paths;
321476
321470
  branding_svg_path;
321471
+ image_generated;
321477
321472
  versioning;
321478
321473
  prettier;
321479
321474
  /**
@@ -321488,6 +321483,7 @@ var GHActionDocsConfig = class {
321488
321483
  this.title = config.title;
321489
321484
  this.paths = config.paths;
321490
321485
  this.branding_svg_path = config.branding_svg_path;
321486
+ this.image_generated = config.image_generated;
321491
321487
  this.versioning = config.versioning;
321492
321488
  this.prettier = config.prettier;
321493
321489
  }
package/dist/mjs/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as fs from "node:fs";
2
- import { accessSync, promises, readFileSync } from "node:fs";
2
+ import { accessSync, existsSync, promises, readFileSync } from "node:fs";
3
3
  import * as path$1 from "node:path";
4
4
  import path from "node:path";
5
5
  import * as core from "@actions/core";
@@ -422,15 +422,6 @@ const unicodeWordMatch = /(?:[\dA-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00
422
422
  //#endregion
423
423
  //#region src/helpers.ts
424
424
  /**
425
- * Returns the input value if it is not empty, otherwise returns undefined.
426
- * @param value - The input value to check.
427
- * @returns The input value if it is not empty, otherwise undefined.
428
- */
429
- function undefinedOnEmpty(value) {
430
- if (!value || value === "") return;
431
- return value;
432
- }
433
- /**
434
425
  * Converts the given text to title case.
435
426
  * @param text - The text to convert.
436
427
  * @returns The text converted to title case.
@@ -720,7 +711,10 @@ function getCurrentVersionString(inputs) {
720
711
  versionString = detectedVersion ?? "0.0.0";
721
712
  const prefix = inputs.config.get("versioning:prefix") ?? "v";
722
713
  if (versionSource !== "git-branch" && versionSource !== "git-sha" && versionString && !versionString.startsWith(prefix)) versionString = `${prefix}${versionString}`;
723
- } else versionString = undefinedOnEmpty(inputs.config.get("versioning:branch")) ?? "main";
714
+ } else {
715
+ const configuredBranch = inputs.config.get("versioning:branch");
716
+ versionString = configuredBranch === void 0 || configuredBranch === "" ? "main" : String(configuredBranch);
717
+ }
724
718
  log.debug(`version to use in generated example is ${versionString}`);
725
719
  return versionString;
726
720
  }
@@ -1609,7 +1603,7 @@ function generateImgMarkup(inputs, width = "15%") {
1609
1603
  log.info(`Generating action.yml branding image for ${iconName}`);
1610
1604
  const svg = inputs.config.get("image_generated");
1611
1605
  const hash = `${iconName}${brandColor}`;
1612
- if (svg && hash.localeCompare(svg) !== 0) {
1606
+ if (!svg || hash.localeCompare(svg) !== 0 || !existsSync(svgPath)) {
1613
1607
  generateSvgImage(svgPath, iconName, brandColor);
1614
1608
  inputs.config.set("image_generated", hash);
1615
1609
  }
@@ -2088,6 +2082,7 @@ var GHActionDocsConfig = class {
2088
2082
  title;
2089
2083
  paths;
2090
2084
  branding_svg_path;
2085
+ image_generated;
2091
2086
  versioning;
2092
2087
  prettier;
2093
2088
  /**
@@ -2102,6 +2097,7 @@ var GHActionDocsConfig = class {
2102
2097
  this.title = config.title;
2103
2098
  this.paths = config.paths;
2104
2099
  this.branding_svg_path = config.branding_svg_path;
2100
+ this.image_generated = config.image_generated;
2105
2101
  this.versioning = config.versioning;
2106
2102
  this.prettier = config.prettier;
2107
2103
  }
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.3",
4
+ "version": "1.12.5",
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",