github-action-readme-generator 1.10.1 → 1.10.2

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.
@@ -1,7 +1,8 @@
1
- import type { Context } from '@actions/github/lib/context.js';
1
+ import { context } from '@actions/github';
2
2
  import type Inputs from './inputs.js';
3
3
  import LogTask from './logtask/index.js';
4
4
  import { type Nullable } from './util.js';
5
+ type Context = typeof context;
5
6
  /**
6
7
  * Returns the input value if it is not empty, otherwise returns undefined.
7
8
  * @param value - The input value to check.
@@ -89,3 +90,4 @@ export declare function getCurrentVersionString(inputs: Inputs): string;
89
90
  export declare function indexOfRegex(str: string, providedRegex: RegExp): number;
90
91
  export declare function lastIndexOfRegex(str: string, providedRegex: RegExp): number;
91
92
  export declare function isObject(value: unknown): value is object;
93
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAMlC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAiB,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAyB;IACxD,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe;IACtC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,O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accessSync, readFileSync } from 'node:fs';\nimport * as path from 'node:path';\n\nimport type { Context } from '@actions/github/lib/context.js';\nimport type { PackageJson } from 'types-package-json';\n\nimport type Inputs from './inputs.js';\nimport LogTask from './logtask/index.js';\nimport { unicodeWordMatch } from './unicode-word-match.js';\nimport { type Nullable, notEmpty } from './util.js';\n/**\n * Returns the input value if it is not empty, otherwise returns undefined.\n * @param value - The input value to check.\n * @returns The input value if it is not empty, otherwise undefined.\n */\nexport function undefinedOnEmpty(value: string | undefined): string | undefined {\n if (!value || value === '') {\n return undefined;\n }\n return value;\n}\n\n/**\n * Returns the basename of the given path.\n * @param pathStr - The path to extract the basename from.\n * @returns The basename of the path.\n */\nexport function basename(pathStr: string): string | undefined {\n if (!pathStr) {\n return undefined;\n }\n const log = new LogTask('basename');\n const result = path.basename(pathStr);\n log.debug(`Basename passed ${pathStr} and returns ${result}`);\n return result;\n}\n/**\n * Removes the \"refs/heads/\" or \"refs/tags/\" prefix from the given path.\n *\n * @param pathStr - The path to remove the prefix from\n * @returns The path without the prefix, or null if path is empty\n */\nexport function stripRefs(pathStr: string): string | null {\n if (!pathStr) {\n return null;\n }\n const log = new LogTask('stripRefs');\n const result = pathStr.replace('refs/heads/', '').replace('refs/tags/', '');\n log.debug(`stripRefs passed ${pathStr} and returns ${result}`);\n return result;\n}\n\n/**\n * Converts the given text to title case.\n * @param text - The text to convert.\n * @returns The text converted to title case.\n * @throws {TypeError} If the input is not a string.\n */\nexport function titlecase(text: string): string | undefined {\n if (!text) {\n return undefined;\n }\n if (typeof text !== 'string') {\n throw new TypeError(`Invalid argument type provided to titlecase(): ${typeof text}`);\n }\n return text.replaceAll(unicodeWordMatch, (txt) =>\n txt[0] ? txt[0].toUpperCase() + txt.slice(1).toLowerCase() : txt,\n );\n}\n\n/**\n * Parses the given text and converts it to title case, replacing underscores and dashes with spaces.\n * @param text - The text to parse and convert.\n * @returns The parsed text converted to title case.\n */\nexport function prefixParser(text: string | undefined): string | undefined {\n if (!text) {\n return undefined;\n }\n if (typeof text !== 'string') {\n throw new TypeError(`Invalid argument type provided to prefixParser(): ${typeof text}`);\n }\n return titlecase(text.replace(/[_-]+/, ' '));\n}\n\n/**\n * Wraps the given text into multiple lines with a maximum width of 80 characters.\n * @param text - The text to wrap.\n * @param content - The array to store the wrapped lines.\n * @param prepend - The string to prepend to each wrapped line.\n * @returns The array of wrapped lines.\n */\nexport function wrapText(\n text: string | undefined,\n content: string[],\n prepend: string = '',\n): string[] {\n // Constrain the width of the description\n if (!text) {\n return content;\n }\n const width = 80;\n\n let description = text\n .trim()\n .replaceAll('\\r\\n', '\\n') // Convert CR to LF\n .replaceAll(/ +/g, ' ') // Squash consecutive spaces\n .replaceAll(' \\n', '\\n'); // Squash space followed by newline\n\n while (description) {\n // Longer than width? Find a space to break apart\n let segment: string;\n if (description.length > width) {\n segment = description.slice(0, Math.max(0, width + 1));\n while (!segment.endsWith(' ') && !segment.endsWith('\\n') && segment) {\n segment = segment.slice(0, Math.max(0, segment.length - 1));\n }\n\n // Trimmed too much?\n if (segment.length < width * 0.67) {\n segment = description;\n }\n } else {\n segment = description;\n }\n\n // Check for newline\n const newlineIndex = segment.indexOf('\\n');\n if (newlineIndex >= 0) {\n segment = segment.slice(0, Math.max(0, newlineIndex + 1));\n }\n content.push(`${prepend}${segment}`.trimEnd());\n // Remaining\n description = description.slice(segment.length);\n }\n return content;\n}\n\n/**\n * Represents a repository with owner and repo properties.\n */\nexport interface Repo {\n owner: string;\n repo: string;\n}\n\nexport function readFile(filename: string): string {\n try {\n return readFileSync(filename, 'utf8');\n } catch (error) {\n throw new Error(`Cannot read file ${filename}: ${error}`);\n }\n}\n\nexport function repoObjFromRepoName(\n repository: Nullable<string>,\n log: LogTask,\n from?: string,\n): Nullable<Repo> {\n if (notEmpty(repository)) {\n const [owner, repo] = repository.split('/');\n if (owner && repo) {\n log.debug(`repoObjFromRepoName using ${from} and returns ${JSON.stringify({ owner, repo })}`);\n return { owner, repo };\n }\n }\n return undefined;\n}\n// Pattern to match GitHub remote URLs in .git/config\n// Handles both HTTPS (github.com/) and SSH (github.com:) formats\n// Captures the repo name with or without .git suffix - suffix is stripped in code\nexport const remoteGitUrlPattern = /url\\s*=\\s*.*github\\.com[/:](?<owner>[^/\\s]+)\\/(?<repo>[^\\s]+)/;\n/**\n * Finds the repository information from the input, context, environment variables, or git configuration.\n * @param inputRepo - The input repository string.\n * @param context - The GitHub context object.\n * @param baseDir - Optional base directory to look for .git/config (defaults to CWD).\n * @returns The repository information (owner and repo) or null if not found.\n */\nexport function repositoryFinder(\n inputRepo: Nullable<string>,\n context: Nullable<Context>,\n baseDir?: string,\n): Repo | null {\n const log = new LogTask('repositoryFinder');\n /**\n * Attempt to get git user and repo from input\n */\n const repoObj = repoObjFromRepoName(inputRepo, log, 'inputRepo');\n\n if (repoObj) {\n return repoObj;\n }\n\n /**\n * When baseDir is provided, prioritize .git/config from that directory\n * This is critical for external repos where GITHUB_REPOSITORY points to\n * the workflow repo, not the target repo being documented\n */\n if (baseDir) {\n try {\n const gitConfigPath = path.join(baseDir, '.git', 'config');\n const fileContent = readFile(gitConfigPath);\n log.debug(`Reading git config from: ${gitConfigPath}`);\n const results = remoteGitUrlPattern.exec(fileContent);\n if (results?.groups?.owner && results?.groups?.repo) {\n // Strip .git suffix if present (actions/checkout may or may not include it)\n const repo = results.groups.repo.replace(/\\.git$/, '');\n log.debug(\n `repositoryFinder using '${gitConfigPath}' and returns ${JSON.stringify({ owner: results.groups.owner, repo })}`,\n );\n return {\n owner: results.groups.owner,\n repo,\n };\n } else {\n log.debug(`No remote URL found in ${gitConfigPath}`);\n }\n } catch (error) {\n log.debug(`Couldn't read .git/config from baseDir ${baseDir}: ${error}`);\n // Fall through to other methods\n }\n }\n\n /**\n * Attempt to get git user and repo from GitHub context,\n * which includes checking for GITHUB_REPOSITORY environment variable\n */\n if (context) {\n try {\n const result = { ...context.repo };\n if (result.owner && result.repo) {\n log.debug(`repositoryFinder using GitHub context and returns ${JSON.stringify(result)}`);\n return result;\n }\n } catch (error) {\n log.debug(`repositoryFinder using GitHub context gives error ${JSON.stringify(error)}`);\n }\n }\n\n /**\n * Fallback: Try to parse GITHUB_REPOSITORY environment variable directly\n * This handles cases where the Context class doesn't pick up the value\n */\n const githubRepo = process.env.GITHUB_REPOSITORY;\n if (githubRepo) {\n const repoFromEnv = repoObjFromRepoName(githubRepo, log, 'GITHUB_REPOSITORY env');\n if (repoFromEnv) {\n return repoFromEnv;\n }\n }\n\n /**\n * Last resort: Attempt to get git user and repo from .git/config in CWD\n */\n try {\n const fileContent = readFile('.git/config');\n log.debug('Reading git config from: .git/config');\n const results = remoteGitUrlPattern.exec(fileContent);\n if (results?.groups?.owner && results?.groups?.repo) {\n // Strip .git suffix if present\n const repo = results.groups.repo.replace(/\\.git$/, '');\n log.debug(\n `repositoryFinder using '.git/config' and returns ${JSON.stringify({ owner: results.groups.owner, repo })}`,\n );\n return {\n owner: results.groups.owner,\n repo,\n };\n } else {\n log.debug('No remote URL found in .git/config');\n }\n } catch (error) {\n // can't find it\n log.error(`Couldn't retrieve owner or repo in .git/config file: ${error}`);\n }\n throw new Error('No owner or repo found');\n}\n\n/**\n * Returns the default branch of the git repository.\n * @returns The default branch.\n */\n/**\n * Gets the default branch for the Git repository.\n *\n * @returns The name of the default branch.\n */\nexport function getDefaultGitBranch(): string {\n let result: Buffer | undefined;\n try {\n // Run git command to get default branch\n result = execSync('git symbolic-ref HEAD | sed s@^refs/heads/@@');\n } catch (error) {\n // If command fails, try alternative for MacOS\n if (error) {\n try {\n result = execSync(\n \"git remote set-head origin -a;git remote show origin | head 50 sed -n 's/^.*default branch \\\\(.*\\\\)/\\\\1/p'\",\n );\n } catch {\n result = execSync(\n \"git remote set-head origin -a;git remote show origin | sed -n 's/^s*HEAD branch: \\\\(.*\\\\)/\\\\1/p'\",\n );\n }\n }\n }\n return result?.toString().trim() ?? '';\n}\n\n/**\n * Formats the given value as a column header.\n * @param value - The value to format.\n * @returns The formatted column header.\n */\nexport function columnHeader(value: string): string {\n if (!value) {\n return '';\n }\n let text: string = value.replaceAll(/\\*\\*(.*?)\\*\\*/g, '$1');\n\n // Remove italic formatting: *italic*\n text = text.replaceAll(/\\*(.*?)\\*/g, '$1');\n\n // Remove strikethrough formatting: ~~strikethrough~~\n text = text.replaceAll(/~~(.*?)~~/g, '$1');\n\n const normalisedHeader = titlecase(text.trim());\n if (normalisedHeader) {\n return `${normalisedHeader}`;\n }\n return '';\n}\n/**\n * Formats the given value as a row header in HTML.\n *\n * Removes formatting from the string and converts it to bold code style.\n *\n * @param value - The string to format as a header\n * @returns The formatted row header string wrapped in bold and code tags\n */\nexport function rowHeader(value: string): string {\n if (!value) {\n return '';\n }\n\n let text = value;\n\n // Remove bold formatting\n text = text.replaceAll(/\\*\\*(.*?)\\*\\*/g, '$1');\n\n // Remove italic formatting: *italic*\n text = text.replaceAll(/\\*(.*?)\\*/g, '$1');\n\n // Remove strikethrough formatting: ~~strikethrough~~\n text = text.replaceAll(/~~(.*?)~~/g, '$1');\n\n // Normalize spacing\n text = text.trim();\n\n // Add bold and code formatting\n return `<b><code>${text}</code></b>`;\n}\n\n/**\n * Gets the version from git tags.\n */\nfunction getVersionFromGitTag(actionDir: string, log: LogTask): string | undefined {\n try {\n const gitVersion = execSync(\n 'git describe --tags --abbrev=0 2>/dev/null || git tag -l \"v*\" --sort=-v:refname | head -1',\n {\n cwd: actionDir,\n encoding: 'utf8',\n },\n ).trim();\n if (gitVersion) {\n // Remove 'v' prefix if present for consistency, we'll add it back with the configured prefix\n const version = gitVersion.replace(/^v/, '');\n log.debug(`version from git tags: ${version}`);\n return version;\n }\n } catch {\n log.debug(`Could not get version from git tags in ${actionDir}`);\n }\n return undefined;\n}\n\n/**\n * Gets the current git branch name.\n */\nfunction getVersionFromGitBranch(actionDir: string, log: LogTask): string | undefined {\n try {\n const branch = execSync('git rev-parse --abbrev-ref HEAD', {\n cwd: actionDir,\n encoding: 'utf8',\n }).trim();\n if (branch && branch !== 'HEAD') {\n log.debug(`version from git branch: ${branch}`);\n return branch;\n }\n } catch {\n log.debug(`Could not get branch name in ${actionDir}`);\n }\n return undefined;\n}\n\n/**\n * Gets the current git commit SHA (short form).\n */\nfunction getVersionFromGitSha(actionDir: string, log: LogTask): string | undefined {\n try {\n const sha = execSync('git rev-parse --short HEAD', {\n cwd: actionDir,\n encoding: 'utf8',\n }).trim();\n if (sha) {\n log.debug(`version from git sha: ${sha}`);\n return sha;\n }\n } catch {\n log.debug(`Could not get commit SHA in ${actionDir}`);\n }\n return undefined;\n}\n\n/**\n * Gets the version from package.json.\n */\nfunction getVersionFromPackageJson(actionDir: string, log: LogTask): string | undefined {\n const packageJsonPath = path.join(actionDir, 'package.json');\n log.debug(`Looking for package.json at: ${packageJsonPath}`);\n try {\n accessSync(packageJsonPath);\n const packageData: Partial<PackageJson> = JSON.parse(readFileSync(packageJsonPath, 'utf8'));\n const version = packageData.version;\n log.debug(`version from package.json: ${version ?? 'not found'}`);\n return version;\n } catch {\n log.debug(`package.json not found at ${packageJsonPath}`);\n }\n return undefined;\n}\n\nexport function getCurrentVersionString(inputs: Inputs): string {\n let versionString = '';\n const log = new LogTask('getCurrentVersionString');\n // Default to enabled if not explicitly set (matches action.yml default of \"true\")\n const versioningEnabled = inputs.config.get('versioning:enabled');\n const isVersioningEnabled =\n versioningEnabled === undefined || versioningEnabled === true || versioningEnabled === 'true';\n\n if (isVersioningEnabled) {\n log.debug('version string in generated example is enabled');\n const override = inputs.config.get('versioning:override') as string;\n const versionSource = (inputs.config.get('versioning:source') as string) ?? 'git-tag';\n const actionDir = path.dirname(inputs.action.path);\n\n log.debug(`version source: ${versionSource}`);\n\n let detectedVersion: string | undefined;\n\n // If override is set and we're in explicit mode, use it directly\n if (versionSource === 'explicit') {\n if (override && override.length > 0) {\n detectedVersion = override;\n log.debug(`using explicit version override: ${detectedVersion}`);\n } else {\n log.debug('explicit mode but no version_override set, falling back to 0.0.0');\n detectedVersion = '0.0.0';\n }\n } else {\n // Get version based on selected source\n switch (versionSource) {\n case 'git-branch':\n detectedVersion = getVersionFromGitBranch(actionDir, log);\n break;\n case 'git-sha':\n detectedVersion = getVersionFromGitSha(actionDir, log);\n break;\n case 'package-json':\n detectedVersion = getVersionFromPackageJson(actionDir, log);\n break;\n case 'git-tag':\n default:\n // For git-tag (default), use the legacy fallback behavior\n detectedVersion = getVersionFromGitTag(actionDir, log);\n if (!detectedVersion) {\n detectedVersion = getVersionFromPackageJson(actionDir, log);\n }\n if (!detectedVersion) {\n detectedVersion = process.env.npm_package_version;\n log.debug(`Falling back to env:npm_package_version: ${detectedVersion ?? 'not found'}`);\n }\n break;\n }\n\n // Override takes precedence if set (except for explicit mode which is handled above)\n if (override && override.length > 0) {\n detectedVersion = override;\n log.debug(`using version override: ${detectedVersion}`);\n }\n }\n\n versionString = detectedVersion ?? '0.0.0';\n\n // Get prefix, defaulting to 'v' if not set\n // For git-branch and git-sha, we typically don't want a prefix\n const prefix = (inputs.config.get('versioning:prefix') as string) ?? 'v';\n const shouldApplyPrefix = versionSource !== 'git-branch' && versionSource !== 'git-sha';\n\n if (shouldApplyPrefix && versionString && !versionString.startsWith(prefix)) {\n versionString = `${prefix}${versionString}`;\n }\n } else {\n versionString = inputs.config.get('versioning:branch') as string;\n }\n log.debug(`version to use in generated example is ${versionString}`);\n return versionString;\n}\n\nexport function indexOfRegex(str: string, providedRegex: RegExp): number {\n const regex = providedRegex.global\n ? providedRegex\n : new RegExp(providedRegex.source, `${providedRegex.flags}g`);\n let index = -1;\n let match: RegExpExecArray | null = regex.exec(str);\n while (match) {\n index = match.index;\n match = regex.exec(str);\n }\n return index;\n}\n\nexport function lastIndexOfRegex(str: string, providedRegex: RegExp): number {\n const regex = providedRegex.global\n ? providedRegex\n : new RegExp(providedRegex.source, `${providedRegex.flags}g`);\n let index = -1;\n let match: RegExpExecArray | null = regex.exec(str);\n while (match) {\n index = match.index + match[0].length;\n match = regex.exec(str);\n }\n return index;\n}\n\nexport function isObject(value: unknown): value is object {\n const type = typeof value;\n return type === 'object' && !!value;\n}\n"]}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAOlC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAiB,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIpD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAyB;IACxD,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe;IACtC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACtC,GAAG,CAAC,KAAK,CAAC,mBAAmB,OAAO,gBAAgB,MAAM,EAAE,CAAC,CAAC;IAC9D,OAAO,MAAM,CAAC;AAChB,CAAC;AACD;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,EA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AAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAW,EAAE,aAAqB;IACjE,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM;QAChC,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,IAAI,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,aAAa,CAAC,KAAK,GAAG,CAAC,CAAC;IAChE,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;IACf,IAAI,KAAK,GAA2B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpD,OAAO,KAAK,EAAE,CAAC;QACb,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACtC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;IAC1B,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,CAAC;AACtC,CAAC","sourcesContent":["import { execSync } from 'node:child_process';\nimport { accessSync, readFileSync } from 'node:fs';\nimport * as path from 'node:path';\n\n// biome-ignore lint/style/useImportType: context is imported as a value to derive the type using typeof\nimport { context } from '@actions/github';\nimport type { PackageJson } from 'types-package-json';\n\nimport type Inputs from './inputs.js';\nimport LogTask from './logtask/index.js';\nimport { unicodeWordMatch } from './unicode-word-match.js';\nimport { type Nullable, notEmpty } from './util.js';\n\n// Type alias for Context from the exported context instance\ntype Context = typeof context;\n/**\n * Returns the input value if it is not empty, otherwise returns undefined.\n * @param value - The input value to check.\n * @returns The input value if it is not empty, otherwise undefined.\n */\nexport function undefinedOnEmpty(value: string | undefined): string | undefined {\n if (!value || value === '') {\n return undefined;\n }\n return value;\n}\n\n/**\n * Returns the basename of the given path.\n * @param pathStr - The path to extract the basename from.\n * @returns The basename of the path.\n */\nexport function basename(pathStr: string): string | undefined {\n if (!pathStr) {\n return undefined;\n }\n const log = new LogTask('basename');\n const result = path.basename(pathStr);\n log.debug(`Basename passed ${pathStr} and returns ${result}`);\n return result;\n}\n/**\n * Removes the \"refs/heads/\" or \"refs/tags/\" prefix from the given path.\n *\n * @param pathStr - The path to remove the prefix from\n * @returns The path without the prefix, or null if path is empty\n */\nexport function stripRefs(pathStr: string): string | null {\n if (!pathStr) {\n return null;\n }\n const log = new LogTask('stripRefs');\n const result = pathStr.replace('refs/heads/', '').replace('refs/tags/', '');\n log.debug(`stripRefs passed ${pathStr} and returns ${result}`);\n return result;\n}\n\n/**\n * Converts the given text to title case.\n * @param text - The text to convert.\n * @returns The text converted to title case.\n * @throws {TypeError} If the input is not a string.\n */\nexport function titlecase(text: string): string | undefined {\n if (!text) {\n return undefined;\n }\n if (typeof text !== 'string') {\n throw new TypeError(`Invalid argument type provided to titlecase(): ${typeof text}`);\n }\n return text.replaceAll(unicodeWordMatch, (txt) =>\n txt[0] ? txt[0].toUpperCase() + txt.slice(1).toLowerCase() : txt,\n );\n}\n\n/**\n * Parses the given text and converts it to title case, replacing underscores and dashes with spaces.\n * @param text - The text to parse and convert.\n * @returns The parsed text converted to title case.\n */\nexport function prefixParser(text: string | undefined): string | undefined {\n if (!text) {\n return undefined;\n }\n if (typeof text !== 'string') {\n throw new TypeError(`Invalid argument type provided to prefixParser(): ${typeof text}`);\n }\n return titlecase(text.replace(/[_-]+/, ' '));\n}\n\n/**\n * Wraps the given text into multiple lines with a maximum width of 80 characters.\n * @param text - The text to wrap.\n * @param content - The array to store the wrapped lines.\n * @param prepend - The string to prepend to each wrapped line.\n * @returns The array of wrapped lines.\n */\nexport function wrapText(\n text: string | undefined,\n content: string[],\n prepend: string = '',\n): string[] {\n // Constrain the width of the description\n if (!text) {\n return content;\n }\n const width = 80;\n\n let description = text\n .trim()\n .replaceAll('\\r\\n', '\\n') // Convert CR to LF\n .replaceAll(/ +/g, ' ') // Squash consecutive spaces\n .replaceAll(' \\n', '\\n'); // Squash space followed by newline\n\n while (description) {\n // Longer than width? Find a space to break apart\n let segment: string;\n if (description.length > width) {\n segment = description.slice(0, Math.max(0, width + 1));\n while (!segment.endsWith(' ') && !segment.endsWith('\\n') && segment) {\n segment = segment.slice(0, Math.max(0, segment.length - 1));\n }\n\n // Trimmed too much?\n if (segment.length < width * 0.67) {\n segment = description;\n }\n } else {\n segment = description;\n }\n\n // Check for newline\n const newlineIndex = segment.indexOf('\\n');\n if (newlineIndex >= 0) {\n segment = segment.slice(0, Math.max(0, newlineIndex + 1));\n }\n content.push(`${prepend}${segment}`.trimEnd());\n // Remaining\n description = description.slice(segment.length);\n }\n return content;\n}\n\n/**\n * Represents a repository with owner and repo properties.\n */\nexport interface Repo {\n owner: string;\n repo: string;\n}\n\nexport function readFile(filename: string): string {\n try {\n return readFileSync(filename, 'utf8');\n } catch (error) {\n throw new Error(`Cannot read file ${filename}: ${error}`);\n }\n}\n\nexport function repoObjFromRepoName(\n repository: Nullable<string>,\n log: LogTask,\n from?: string,\n): Nullable<Repo> {\n if (notEmpty(repository)) {\n const [owner, repo] = repository.split('/');\n if (owner && repo) {\n log.debug(`repoObjFromRepoName using ${from} and returns ${JSON.stringify({ owner, repo })}`);\n return { owner, repo };\n }\n }\n return undefined;\n}\n// Pattern to match GitHub remote URLs in .git/config\n// Handles both HTTPS (github.com/) and SSH (github.com:) formats\n// Captures the repo name with or without .git suffix - suffix is stripped in code\nexport const remoteGitUrlPattern = /url\\s*=\\s*.*github\\.com[/:](?<owner>[^/\\s]+)\\/(?<repo>[^\\s]+)/;\n/**\n * Finds the repository information from the input, context, environment variables, or git configuration.\n * @param inputRepo - The input repository string.\n * @param context - The GitHub context object.\n * @param baseDir - Optional base directory to look for .git/config (defaults to CWD).\n * @returns The repository information (owner and repo) or null if not found.\n */\nexport function repositoryFinder(\n inputRepo: Nullable<string>,\n context: Nullable<Context>,\n baseDir?: string,\n): Repo | null {\n const log = new LogTask('repositoryFinder');\n /**\n * Attempt to get git user and repo from input\n */\n const repoObj = repoObjFromRepoName(inputRepo, log, 'inputRepo');\n\n if (repoObj) {\n return repoObj;\n }\n\n /**\n * When baseDir is provided, prioritize .git/config from that directory\n * This is critical for external repos where GITHUB_REPOSITORY points to\n * the workflow repo, not the target repo being documented\n */\n if (baseDir) {\n try {\n const gitConfigPath = path.join(baseDir, '.git', 'config');\n const fileContent = readFile(gitConfigPath);\n log.debug(`Reading git config from: ${gitConfigPath}`);\n const results = remoteGitUrlPattern.exec(fileContent);\n if (results?.groups?.owner && results?.groups?.repo) {\n // Strip .git suffix if present (actions/checkout may or may not include it)\n const repo = results.groups.repo.replace(/\\.git$/, '');\n log.debug(\n `repositoryFinder using '${gitConfigPath}' and returns ${JSON.stringify({ owner: results.groups.owner, repo })}`,\n );\n return {\n owner: results.groups.owner,\n repo,\n };\n } else {\n log.debug(`No remote URL found in ${gitConfigPath}`);\n }\n } catch (error) {\n log.debug(`Couldn't read .git/config from baseDir ${baseDir}: ${error}`);\n // Fall through to other methods\n }\n }\n\n /**\n * Attempt to get git user and repo from GitHub context,\n * which includes checking for GITHUB_REPOSITORY environment variable\n */\n if (context) {\n try {\n const result = { ...context.repo };\n if (result.owner && result.repo) {\n log.debug(`repositoryFinder using GitHub context and returns ${JSON.stringify(result)}`);\n return result;\n }\n } catch (error) {\n log.debug(`repositoryFinder using GitHub context gives error ${JSON.stringify(error)}`);\n }\n }\n\n /**\n * Fallback: Try to parse GITHUB_REPOSITORY environment variable directly\n * This handles cases where the Context class doesn't pick up the value\n */\n const githubRepo = process.env.GITHUB_REPOSITORY;\n if (githubRepo) {\n const repoFromEnv = repoObjFromRepoName(githubRepo, log, 'GITHUB_REPOSITORY env');\n if (repoFromEnv) {\n return repoFromEnv;\n }\n }\n\n /**\n * Last resort: Attempt to get git user and repo from .git/config in CWD\n */\n try {\n const fileContent = readFile('.git/config');\n log.debug('Reading git config from: .git/config');\n const results = remoteGitUrlPattern.exec(fileContent);\n if (results?.groups?.owner && results?.groups?.repo) {\n // Strip .git suffix if present\n const repo = results.groups.repo.replace(/\\.git$/, '');\n log.debug(\n `repositoryFinder using '.git/config' and returns ${JSON.stringify({ owner: results.groups.owner, repo })}`,\n );\n return {\n owner: results.groups.owner,\n repo,\n };\n } else {\n log.debug('No remote URL found in .git/config');\n }\n } catch (error) {\n // can't find it\n log.error(`Couldn't retrieve owner or repo in .git/config file: ${error}`);\n }\n throw new Error('No owner or repo found');\n}\n\n/**\n * Returns the default branch of the git repository.\n * @returns The default branch.\n */\n/**\n * Gets the default branch for the Git repository.\n *\n * @returns The name of the default branch.\n */\nexport function getDefaultGitBranch(): string {\n let result: Buffer | undefined;\n try {\n // Run git command to get default branch\n result = execSync('git symbolic-ref HEAD | sed s@^refs/heads/@@');\n } catch (error) {\n // If command fails, try alternative for MacOS\n if (error) {\n try {\n result = execSync(\n \"git remote set-head origin -a;git remote show origin | head 50 sed -n 's/^.*default branch \\\\(.*\\\\)/\\\\1/p'\",\n );\n } catch {\n result = execSync(\n \"git remote set-head origin -a;git remote show origin | sed -n 's/^s*HEAD branch: \\\\(.*\\\\)/\\\\1/p'\",\n );\n }\n }\n }\n return result?.toString().trim() ?? '';\n}\n\n/**\n * Formats the given value as a column header.\n * @param value - The value to format.\n * @returns The formatted column header.\n */\nexport function columnHeader(value: string): string {\n if (!value) {\n return '';\n }\n let text: string = value.replaceAll(/\\*\\*(.*?)\\*\\*/g, '$1');\n\n // Remove italic formatting: *italic*\n text = text.replaceAll(/\\*(.*?)\\*/g, '$1');\n\n // Remove strikethrough formatting: ~~strikethrough~~\n text = text.replaceAll(/~~(.*?)~~/g, '$1');\n\n const normalisedHeader = titlecase(text.trim());\n if (normalisedHeader) {\n return `${normalisedHeader}`;\n }\n return '';\n}\n/**\n * Formats the given value as a row header in HTML.\n *\n * Removes formatting from the string and converts it to bold code style.\n *\n * @param value - The string to format as a header\n * @returns The formatted row header string wrapped in bold and code tags\n */\nexport function rowHeader(value: string): string {\n if (!value) {\n return '';\n }\n\n let text = value;\n\n // Remove bold formatting\n text = text.replaceAll(/\\*\\*(.*?)\\*\\*/g, '$1');\n\n // Remove italic formatting: *italic*\n text = text.replaceAll(/\\*(.*?)\\*/g, '$1');\n\n // Remove strikethrough formatting: ~~strikethrough~~\n text = text.replaceAll(/~~(.*?)~~/g, '$1');\n\n // Normalize spacing\n text = text.trim();\n\n // Add bold and code formatting\n return `<b><code>${text}</code></b>`;\n}\n\n/**\n * Gets the version from git tags.\n */\nfunction getVersionFromGitTag(actionDir: string, log: LogTask): string | undefined {\n try {\n const gitVersion = execSync(\n 'git describe --tags --abbrev=0 2>/dev/null || git tag -l \"v*\" --sort=-v:refname | head -1',\n {\n cwd: actionDir,\n encoding: 'utf8',\n },\n ).trim();\n if (gitVersion) {\n // Remove 'v' prefix if present for consistency, we'll add it back with the configured prefix\n const version = gitVersion.replace(/^v/, '');\n log.debug(`version from git tags: ${version}`);\n return version;\n }\n } catch {\n log.debug(`Could not get version from git tags in ${actionDir}`);\n }\n return undefined;\n}\n\n/**\n * Gets the current git branch name.\n */\nfunction getVersionFromGitBranch(actionDir: string, log: LogTask): string | undefined {\n try {\n const branch = execSync('git rev-parse --abbrev-ref HEAD', {\n cwd: actionDir,\n encoding: 'utf8',\n }).trim();\n if (branch && branch !== 'HEAD') {\n log.debug(`version from git branch: ${branch}`);\n return branch;\n }\n } catch {\n log.debug(`Could not get branch name in ${actionDir}`);\n }\n return undefined;\n}\n\n/**\n * Gets the current git commit SHA (short form).\n */\nfunction getVersionFromGitSha(actionDir: string, log: LogTask): string | undefined {\n try {\n const sha = execSync('git rev-parse --short HEAD', {\n cwd: actionDir,\n encoding: 'utf8',\n }).trim();\n if (sha) {\n log.debug(`version from git sha: ${sha}`);\n return sha;\n }\n } catch {\n log.debug(`Could not get commit SHA in ${actionDir}`);\n }\n return undefined;\n}\n\n/**\n * Gets the version from package.json.\n */\nfunction getVersionFromPackageJson(actionDir: string, log: LogTask): string | undefined {\n const packageJsonPath = path.join(actionDir, 'package.json');\n log.debug(`Looking for package.json at: ${packageJsonPath}`);\n try {\n accessSync(packageJsonPath);\n const packageData: Partial<PackageJson> = JSON.parse(readFileSync(packageJsonPath, 'utf8'));\n const version = packageData.version;\n log.debug(`version from package.json: ${version ?? 'not found'}`);\n return version;\n } catch {\n log.debug(`package.json not found at ${packageJsonPath}`);\n }\n return undefined;\n}\n\nexport function getCurrentVersionString(inputs: Inputs): string {\n let versionString = '';\n const log = new LogTask('getCurrentVersionString');\n // Default to enabled if not explicitly set (matches action.yml default of \"true\")\n const versioningEnabled = inputs.config.get('versioning:enabled');\n const isVersioningEnabled =\n versioningEnabled === undefined || versioningEnabled === true || versioningEnabled === 'true';\n\n if (isVersioningEnabled) {\n log.debug('version string in generated example is enabled');\n const override = inputs.config.get('versioning:override') as string;\n const versionSource = (inputs.config.get('versioning:source') as string) ?? 'git-tag';\n const actionDir = path.dirname(inputs.action.path);\n\n log.debug(`version source: ${versionSource}`);\n\n let detectedVersion: string | undefined;\n\n // If override is set and we're in explicit mode, use it directly\n if (versionSource === 'explicit') {\n if (override && override.length > 0) {\n detectedVersion = override;\n log.debug(`using explicit version override: ${detectedVersion}`);\n } else {\n log.debug('explicit mode but no version_override set, falling back to 0.0.0');\n detectedVersion = '0.0.0';\n }\n } else {\n // Get version based on selected source\n switch (versionSource) {\n case 'git-branch':\n detectedVersion = getVersionFromGitBranch(actionDir, log);\n break;\n case 'git-sha':\n detectedVersion = getVersionFromGitSha(actionDir, log);\n break;\n case 'package-json':\n detectedVersion = getVersionFromPackageJson(actionDir, log);\n break;\n case 'git-tag':\n default:\n // For git-tag (default), use the legacy fallback behavior\n detectedVersion = getVersionFromGitTag(actionDir, log);\n if (!detectedVersion) {\n detectedVersion = getVersionFromPackageJson(actionDir, log);\n }\n if (!detectedVersion) {\n detectedVersion = process.env.npm_package_version;\n log.debug(`Falling back to env:npm_package_version: ${detectedVersion ?? 'not found'}`);\n }\n break;\n }\n\n // Override takes precedence if set (except for explicit mode which is handled above)\n if (override && override.length > 0) {\n detectedVersion = override;\n log.debug(`using version override: ${detectedVersion}`);\n }\n }\n\n versionString = detectedVersion ?? '0.0.0';\n\n // Get prefix, defaulting to 'v' if not set\n // For git-branch and git-sha, we typically don't want a prefix\n const prefix = (inputs.config.get('versioning:prefix') as string) ?? 'v';\n const shouldApplyPrefix = versionSource !== 'git-branch' && versionSource !== 'git-sha';\n\n if (shouldApplyPrefix && versionString && !versionString.startsWith(prefix)) {\n versionString = `${prefix}${versionString}`;\n }\n } else {\n versionString = inputs.config.get('versioning:branch') as string;\n }\n log.debug(`version to use in generated example is ${versionString}`);\n return versionString;\n}\n\nexport function indexOfRegex(str: string, providedRegex: RegExp): number {\n const regex = providedRegex.global\n ? providedRegex\n : new RegExp(providedRegex.source, `${providedRegex.flags}g`);\n let index = -1;\n let match: RegExpExecArray | null = regex.exec(str);\n while (match) {\n index = match.index;\n match = regex.exec(str);\n }\n return index;\n}\n\nexport function lastIndexOfRegex(str: string, providedRegex: RegExp): number {\n const regex = providedRegex.global\n ? providedRegex\n : new RegExp(providedRegex.source, `${providedRegex.flags}g`);\n let index = -1;\n let match: RegExpExecArray | null = regex.exec(str);\n while (match) {\n index = match.index + match[0].length;\n match = regex.exec(str);\n }\n return index;\n}\n\nexport function isObject(value: unknown): value is object {\n const type = typeof value;\n return type === 'object' && !!value;\n}\n"]}
@@ -1,5 +1,7 @@
1
- import { Context } from '@actions/github/lib/context.js';
1
+ import { context as githubContext } from '@actions/github';
2
2
  import nconf from 'nconf';
3
+ type Context = typeof githubContext;
4
+ declare const Context: new () => Context;
3
5
  import Action, { type Input } from './Action.js';
4
6
  import { type ReadmeSection } from './constants.js';
5
7
  import LogTask from './logtask/index.js';
@@ -7,9 +7,10 @@
7
7
  import * as fs from 'node:fs';
8
8
  import * as path from 'node:path';
9
9
  import * as core from '@actions/core';
10
- import { Context } from '@actions/github/lib/context.js';
10
+ import { context as githubContext } from '@actions/github';
11
11
  import nconf from 'nconf';
12
12
  import YAML from 'yaml';
13
+ const Context = githubContext.constructor;
13
14
  import Action from './Action.js';
14
15
  import { ConfigKeys, configFileName, README_SECTIONS } from './constants.js';
15
16
  import { repositoryFinder } from './helpers.js';
@@ -1 +1 @@
1
- {"version":3,"file":"inputs.js","sourceRoot":"","sources":["../../src/inputs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAsB,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,eAAe,EAAsB,MAAM,gBAAgB,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C,MAAM,EAAE,QAAQ,EAAE,GAAiB,KAAK,CAAC;AAGzC;;GAEG;AACH,qCAAqC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAUjD;;GAEG;AACH,MAAM,WAAW,GAAyB,EAAE,CAAC;AAE7C;;;;;;GAMG;AACH,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG;IAC7B,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,uBAAuB,cAAc,EAAE;IACjD,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,SAAS;CAChB,CAAC;AAEF;;;;;GAKG;AACH,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG;IACpC,KAAK,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC;IAChC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE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AAC,CAAC;IAC3D,CAAC;IAED,SAAS;QACP,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC;gBACH,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;YAC3C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;gBAC3B,WAAW;YACb,CAAC;QACH,CAAC;QACD,kEAAkE;QAClE,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["/**\n * This class handles input configuration and manipulation.\n * It imports various modules and packages for file operations, configuration parsing, and logging.\n * The class has methods for initializing the input configuration, setting default values, and converting the configuration to a string.\n * It also has properties for storing the configuration values, sections, readme path, action instance, and readme editor instance.\n */\nimport * as fs from 'node:fs';\nimport * as path from 'node:path';\n\nimport * as core from '@actions/core';\nimport { Context } from '@actions/github/lib/context.js';\nimport nconf from 'nconf';\nimport YAML from 'yaml';\n\nimport Action, { type Input } from './Action.js';\nimport { ConfigKeys, configFileName, README_SECTIONS, type ReadmeSection } from './constants.js';\nimport { repositoryFinder } from './helpers.js';\nimport LogTask from './logtask/index.js';\nimport ReadmeEditor from './readme-editor.js';\n\nconst { Provider }: typeof nconf = nconf;\ntype IOptions = nconf.IOptions;\n\n/**\n * Change working directory to output of workingDirectory()\n */\n// process.chdir(workingDirectory());\nexport const metaActionPath = '../../action.yml';\n\nexport type ArgvOptionProperties = {\n [key: string]: {\n alias: string | string[];\n describe: string;\n parseValues?: boolean;\n type?: string;\n };\n};\n/**\n * Represents the command line argument options for the application.\n */\nconst argvOptions: ArgvOptionProperties = {};\n\n/**\n * Save option configuration.\n * @property {string} alias - Alias for the save option.\n * @property {string} describe - Description for the save option.\n * @property {boolean} parseValues - Specifies whether to parse values for the save option.\n * @property {string} type - Type of the save option.\n */\nargvOptions[ConfigKeys.Save] = {\n alias: 'save',\n describe: `Save this config to ${configFileName}`,\n parseValues: true,\n type: 'boolean',\n};\n\n/**\n * Paths action option configuration.\n * @property {string | string[]} alias - Alias(es) for the pathsAction option.\n * @property {string} type - Type of the pathsAction option.\n * @property {string} describe - Description for the pathsAction option.\n */\nargvOptions[ConfigKeys.pathsAction] = {\n alias: ['pathsAction', 'action'],\n type: 'string',\n describe: 'Path to the action.yml',\n};\n\n/**\n * Paths readme option configuration.\n * @property {string | string[]} alias - Alias(es) for the pathsReadme option.\n * @property {string} type - Type of the pathsReadme option.\n * @property {string} describe - Description for the pathsReadme option.\n */\nargvOptions[ConfigKeys.pathsReadme] = {\n alias: ['pathsReadme', 'readme'],\n type: 'string',\n describe: 'Path to the README file',\n};\n\n/**\n * Branding SVG path option configuration.\n * @property {string} alias - Alias for the svg option.\n * @property {string} type - Type of the svg option.\n * @property {string} describe - Description for the svg option.\n */\nargvOptions[ConfigKeys.BrandingSvgPath] = {\n alias: 'svg',\n type: 'string',\n describe: 'Save and load the branding svg image in the README from this path',\n};\n\n/**\n * Branding as title prefix option configuration.\n * @property {string} alias - Alias for the branding_prefix option.\n * @property {string} type - Type of the branding_prefix option.\n * @property {boolean} parseValues - Specifies whether to parse values for the branding_prefix option.\n * @property {string} describe - Description for the branding_prefix option.\n */\nargvOptions[ConfigKeys.BrandingAsTitlePrefix] = {\n alias: 'branding_prefix',\n type: 'boolean',\n parseValues: true,\n describe: 'Use the branding svg as a prefix for the README title',\n};\n\n/**\n * Owner option configuration.\n * @property {string} alias - Alias for the owner option.\n * @property {string} type - Type of the owner option.\n * @property {string} describe - Description for the owner option.\n */\nargvOptions[ConfigKeys.Owner] = {\n alias: 'owner',\n type: 'string',\n describe: 'The GitHub Action repository owner. i.e: `bitflight-devops`',\n};\n\n/**\n * Repo option configuration.\n * @property {string} alias - Alias for the repo option.\n * @property {string} type - Type of the repo option.\n * @property {string} describe - Description for the repo option.\n */\nargvOptions[ConfigKeys.Repo] = {\n alias: 'repo',\n type: 'string',\n describe: 'The GitHub Action repository name. i.e: `github-action-readme-generator`',\n};\n\n/**\n * Prettier option configuration.\n * @property {string | string[]} alias - Alias(es) for the prettier option.\n * @property {string} type - Type of the prettier option.\n * @property {boolean} parseValues - Specifies whether to parse values for the prettier option.\n * @property {string} describe - Description for the prettier option.\n */\nargvOptions[ConfigKeys.Prettier] = {\n alias: ['pretty', 'prettier'],\n type: 'boolean',\n parseValues: true,\n describe: 'Format the markdown using prettier formatter',\n};\n\n/**\n * Versioning enabled option configuration.\n * @property {string | string[]} alias - Alias(es) for the versioning_enabled option.\n * @property {string} describe - Description for the versioning_enabled option.\n * @property {boolean} parseValues - Specifies whether to parse values for the versioning_enabled option.\n * @property {string} type - Type of the versioning_enabled option.\n */\nargvOptions[ConfigKeys.VersioningEnabled] = {\n alias: ['versioning', 'versioning_enabled'],\n describe:\n 'Enable the update of the usage version to match the latest version in the package.json file',\n parseValues: true,\n type: 'boolean',\n};\n\n/**\n * Versioning override option configuration.\n * @property {string | string[]} alias - Alias(es) for the versioning_override option.\n * @property {string} describe - Description for the versioning_override option.\n * @property {boolean} parseValues - Specifies whether to parse values for the versioning_override option.\n */\nargvOptions[ConfigKeys.VersioningOverride] = {\n alias: ['setversion', 'versioning_override', 'version_override'],\n describe: 'Set a specific version to display in the README.md',\n parseValues: true,\n};\n\n/**\n * Versioning prefix option configuration.\n * @property {string | string[]} alias - Alias(es) for the version_prefix option.\n * @property {string} describe - Description for the version_prefix option.\n * @property {boolean} parseValues - Specifies whether to parse values for the version_prefix option.\n */\nargvOptions[ConfigKeys.VersioningPrefix] = {\n alias: ['vp', 'version_prefix'],\n describe: \"Prefix the version with this value (if it isn't already prefixed)\",\n parseValues: true,\n};\n\n/**\n * Versioning branch option configuration.\n * @property {string | string[]} alias - Alias(es) for the versioning_default_branch option.\n * @property {string} describe - Description for the versioning_default_branch option.\n * @property {boolean} parseValues - Specifies whether to parse values for the versioning_default_branch option.\n */\nargvOptions[ConfigKeys.VersioningBranch] = {\n alias: ['branch', 'versioning_default_branch'],\n describe: 'If versioning is disabled show this branch instead',\n parseValues: true,\n};\n\n/**\n * Versioning source option configuration.\n * @property {string | string[]} alias - Alias(es) for the version_source option.\n * @property {string} describe - Description for the version_source option.\n * @property {boolean} parseValues - Specifies whether to parse values for the version_source option.\n * @property {string} type - Type of the version_source option.\n */\nargvOptions[ConfigKeys.VersioningSource] = {\n alias: ['version-source', 'version_source', 'versioning_source'],\n describe:\n 'How to detect the action version (git-tag, git-branch, git-sha, package-json, explicit)',\n parseValues: true,\n type: 'string',\n};\n\n/**\n * Include GitHub version badge option configuration.\n * @property {string | string[]} alias - Alias(es) for the include_github_version_badge option.\n * @property {string} describe - Description for the include_github_version_badge option.\n * @property {boolean} parseValues - Specifies whether to parse values for the include_github_version_badge option.\n * @property {string} type - Type of the include_github_version_badge option.\n */\nargvOptions[ConfigKeys.IncludeGithubVersionBadge] = {\n alias: ['version-badge', 'versioning_badge', 'include_github_version_badge'],\n describe: 'Display the current version as a badge',\n parseValues: true,\n type: 'boolean',\n};\n\n/**\n * Title prefix option configuration.\n * @property {string | string[]} alias - Alias(es) for the title_prefix option.\n * @property {string} describe - Description for the title_prefix option.\n * @property {boolean} parseValues - Specifies whether to parse values for the title_prefix option.\n */\nargvOptions[ConfigKeys.TitlePrefix] = {\n alias: ['prefix', 'title_prefix'],\n describe: 'Add a prefix to the README title',\n parseValues: true,\n};\n\n/**\n * Debug Nconf option configuration.\n * @property {string} describe - Description for the debugNconf option.\n * @property {boolean} parseValues - Specifies whether to parse values for the debugNconf option.\n * @property {string} type - Type of the debugNconf option.\n */\nargvOptions[ConfigKeys.DebugNconf] = {\n alias: ['debug_nconf'],\n describe: 'Print out the resolved nconf object with all values',\n parseValues: true,\n type: 'boolean',\n};\n\n/**\n * Debug Config option configuration.\n * @property {string} describe - Description for the debugConfig option.\n * @property {boolean} parseValues - Specifies whether to parse values for the debugConfig option.\n * @property {string} type - Type of the debugConfig option.\n */\nargvOptions[ConfigKeys.DebugConfig] = {\n alias: ['debug_config'],\n describe: 'Print out the resolved nconf object with all values',\n parseValues: true,\n type: 'boolean',\n};\n\n/**\n * Configuration inputs from the github action don't\n * all match the input names when running on cli.\n * This maps the action inputs to the cli.\n */\nconst ConfigKeysInputsMap: Record<string, string> = {\n save: ConfigKeys.Save,\n action: ConfigKeys.pathsAction,\n readme: ConfigKeys.pathsReadme,\n branding_svg_path: ConfigKeys.BrandingSvgPath,\n branding_as_title_prefix: ConfigKeys.BrandingAsTitlePrefix,\n versioning_enabled: ConfigKeys.VersioningEnabled,\n version_prefix: ConfigKeys.VersioningPrefix,\n versioning_default_branch: ConfigKeys.VersioningBranch,\n version_override: ConfigKeys.VersioningOverride,\n version_source: ConfigKeys.VersioningSource,\n include_github_version_badge: ConfigKeys.IncludeGithubVersionBadge,\n owner: ConfigKeys.Owner,\n repo: ConfigKeys.Repo,\n title_prefix: ConfigKeys.TitlePrefix,\n pretty: ConfigKeys.Prettier,\n};\n\n/**\n * Interface for key/value pair object\n */\ntype KVPairType = {\n key: string;\n value: string | undefined;\n};\n\n/**\n * Type alias for Provider instance\n */\ntype ProviderInstance = InstanceType<typeof Provider>;\n\nexport function transformGitHubInputsToArgv(\n log: LogTask,\n _config: ProviderInstance,\n obj: KVPairType,\n): undefined | KVPairType {\n /** The obj.key is always in lowercase, but it checks for it without case sensitivity */\n if (/^(INPUT|input)_[A-Z_a-z]\\w*$/.test(obj.key)) {\n log.debug(`Parsing input: ${obj.key} with ith value: ${obj.value}`);\n const keyParsed = obj.key.replace(/^(INPUT|input)_/, '').toLocaleLowerCase();\n const key = ConfigKeysInputsMap[keyParsed] || keyParsed;\n\n // Skip empty values for owner/repo to allow fallback detection from .git/config or GITHUB_REPOSITORY\n if ((key === 'owner' || key === 'repo') && (!obj.value || obj.value === '')) {\n log.debug(`Ignoring empty ${key} input to allow auto-detection`);\n return undefined;\n }\n\n log.debug(`New input is ${key} with the value ${obj.value}`);\n return { key, value: obj.value };\n }\n log.debug(`Ignoring input: ${obj.key} with ith value: ${obj.value}`);\n return undefined;\n}\n\n/**\n * Sets config value from action file default\n *\n * @param {Action} actionInstance - The action instance\n * @param {string} inputName - The input name\n * @returns {string | boolean | undefined} The default value\n */\nexport function setConfigValueFromActionFileDefault(\n log: LogTask,\n actionInstance: Action,\n inputName: string,\n): string | boolean | undefined {\n if (ConfigKeysInputsMap[inputName] === undefined) {\n log.error(\n `${inputName} from ${\n actionInstance.path\n } does not match a known input. Known inputs are: ${Object.keys(ConfigKeysInputsMap)}`,\n );\n return;\n }\n\n const configName = ConfigKeysInputsMap[inputName];\n const defaultValue = actionInstance.inputDefault(inputName);\n\n log.debug(`Default Value for action.yml: ${inputName} CLI: ${configName} = ${defaultValue}`);\n\n return defaultValue;\n}\n\n/**\n * Collects all default values from action file\n *\n * @returns {IOptions} The default values object\n */\nexport function collectAllDefaultValuesFromAction(\n log: LogTask,\n providedMetaActionPath?: string,\n providedDefaults: {\n [key: string]: Input;\n } = {},\n): IOptions {\n log.debug('Collecting default values from action.yml');\n // This loads the defaults from THIS action's own action.yml file (github-action-readme-generator's action.yml)\n // NOT the user's action.yml file (which is loaded separately via the 'action' input parameter)\n // Therefore, we use import.meta.dirname to find this package's action.yml regardless of where it's installed\n const thisActionPath = path.join(import.meta.dirname, providedMetaActionPath ?? metaActionPath);\n try {\n const defaultValues = {} as IOptions;\n const thisAction = new Action(thisActionPath);\n const defaults: {\n [key: string]: Input;\n } = { ...thisAction.inputs, ...providedDefaults };\n // Collect all of the default values from the action.yml file\n if (defaults) {\n for (const key of Object.keys(defaults)) {\n const mappedKey = ConfigKeysInputsMap[key] ?? key;\n defaultValues[mappedKey] = setConfigValueFromActionFileDefault(log, thisAction, key);\n }\n }\n log.debug(JSON.stringify(defaultValues, null, 2));\n return defaultValues;\n } catch (error) {\n // When running as a CLI tool (e.g., via npx or yarn dlx), the tool's own action.yml\n // may not be present in the node_modules. This is expected behavior, as the tool\n // should still work to generate documentation for other actions.\n log.debug(`Could not load defaults from this tool's action.yml at ${thisActionPath}: ${error}`);\n log.debug('Continuing without default values from action.yml');\n return {} as IOptions;\n }\n}\n\n/**\n * Loads the configuration\n *\n * @returns {ProviderInstance} The configuration instance\n */\nexport function loadConfig(\n log: LogTask,\n providedConfig?: ProviderInstance,\n configFilePath?: string,\n): ProviderInstance {\n log.debug('Loading config from env and argv');\n const config = providedConfig ?? new Provider();\n if (process.env.GITHUB_ACTION === 'true') {\n log.info('Running in GitHub action');\n }\n if (configFilePath) {\n if (fs.existsSync(configFilePath)) {\n log.info(`Config file found: ${configFilePath}`);\n config.file(configFilePath);\n } else {\n log.debug(`Config file not found: ${configFilePath}`);\n }\n }\n\n config\n .env({\n lowerCase: true,\n parseValues: true,\n transform: (obj: KVPairType): undefined | KVPairType => {\n return transformGitHubInputsToArgv(log, config, obj);\n },\n })\n .argv(argvOptions);\n\n return config;\n}\n\n/**\n * Loads the default configuration\n *\n * @param {ProviderInstance} config - The config instance\n * @returns {ProviderInstance} The updated config instance\n */\nexport function loadDefaultConfig(\n log: LogTask,\n config: ProviderInstance,\n providedContext?: Context,\n): ProviderInstance {\n log.debug('Loading default config');\n const defaultValues = collectAllDefaultValuesFromAction(log);\n const context = providedContext ?? new Context();\n\n // Get owner/repo from config (which includes CLI args), falling back to env vars for GitHub Actions\n const ownerFromConfig = config.get('owner') as string | undefined;\n const repoFromConfig = config.get('repo') as string | undefined;\n const ownerInput = ownerFromConfig ?? process.env.INPUT_OWNER ?? '';\n const repoInput = repoFromConfig ?? process.env.INPUT_REPO ?? '';\n\n // Get the action path to derive the target repo directory for .git/config lookup\n const actionPath = config.get(ConfigKeys.pathsAction) as string | undefined;\n const actionDir = actionPath ? path.dirname(path.resolve(actionPath)) : undefined;\n log.debug(`Action directory for repository detection: ${actionDir ?? 'not specified'}`);\n\n const repositoryDetail = repositoryFinder(`${ownerInput}/${repoInput}`, context, actionDir);\n log.debug(`repositoryDetail: ${repositoryDetail}`);\n // Apply the default values from the action.yml file\n return config.defaults({\n ...defaultValues,\n owner: repositoryDetail?.owner,\n repo: repositoryDetail?.repo,\n sections: [...README_SECTIONS] as ReadmeSection[],\n });\n}\n\n/**\n * Represents the required inputs for the action.\n */\nconst RequiredInputs = [\n ConfigKeys.pathsAction,\n ConfigKeys.pathsReadme,\n ConfigKeys.Owner,\n ConfigKeys.Repo,\n] as const;\n\n/**\n * Loads the required configuration\n *\n * @param {ProviderInstance} config - The config instance\n * @returns {ProviderInstance} The updated config instance\n */\nexport function loadRequiredConfig(\n log: LogTask,\n config: ProviderInstance,\n requiredInputs: readonly string[] = RequiredInputs,\n): ProviderInstance {\n log.debug('Loading required config');\n\n return config.required([...requiredInputs]);\n}\n\n/**\n *\n */\nexport function loadAction(log: LogTask, actionPath: string): Action {\n log.debug(`Loading action from: ${actionPath}`);\n if (actionPath) {\n return new Action(path.resolve(actionPath));\n }\n throw new Error(`Action path not found: ${actionPath}`);\n}\n\nexport type InputContext = {\n /**\n * The configuration instance\n */\n config?: ProviderInstance;\n\n /**\n * The readme sections\n */\n sections?: ReadmeSection[];\n\n /**\n * The readme file path\n */\n readmePath?: string;\n\n /**\n * The config file path\n */\n configPath?: string;\n\n /**\n * The action instance\n */\n action?: Action;\n\n /**\n * The readme editor instance\n */\n readmeEditor?: ReadmeEditor;\n\n /**\n * The repository owner\n */\n owner?: string;\n\n /**\n * The repository name\n */\n repo?: string;\n};\n/**\n * Main Inputs class that handles configuration\n */\nexport default class Inputs {\n /**\n * The configuration instance\n */\n config: ProviderInstance;\n\n /**\n * The readme sections\n */\n sections: ReadmeSection[];\n\n /**\n * The readme file path\n */\n readmePath: string;\n\n /**\n * The config file path\n */\n configPath: string;\n\n /**\n * The action instance\n */\n action: Action;\n\n /**\n * The readme editor instance\n */\n readmeEditor: ReadmeEditor;\n\n /**\n * The repository owner\n */\n owner: string;\n\n /**\n * The repository name\n */\n repo: string;\n\n /** The logger for this instance */\n log: LogTask;\n\n /**\n * Initializes a new instance of the Inputs class.\n */\n constructor(providedInputContext: InputContext = {}, log: LogTask = new LogTask('inputs')) {\n this.log = log ?? new LogTask('inputs');\n this.log.debug('Initializing Inputs');\n const inputContext = providedInputContext ?? {};\n this.configPath = inputContext.configPath ?? path.resolve(configFileName);\n this.config = inputContext.config ?? new Provider();\n loadConfig(log, this.config, this.configPath);\n loadDefaultConfig(log, this.config);\n loadRequiredConfig(log, this.config);\n\n this.action = inputContext.action ?? loadAction(log, this.config.get(ConfigKeys.pathsAction));\n this.config.set(\n 'sections',\n inputContext.sections ?? (this.config.get('sections') as ReadmeSection[]),\n );\n this.sections = this.config.get('sections') as ReadmeSection[];\n this.readmePath =\n inputContext.readmePath ?? path.resolve(this.config.get(ConfigKeys.pathsReadme) as string);\n this.readmeEditor = inputContext.readmeEditor ?? new ReadmeEditor(this.readmePath);\n /**\n * Output the readme path that is being parsed\n */\n if (process.env.GITHUB_ACTIONS) {\n core.setOutput('readme', this.readmePath);\n }\n /**\n * owner is required, and if it doesn't exist it is handled by nconf which throws an error\n */\n this.owner = inputContext.owner ?? this.config.get('owner');\n\n /**\n * repo is required, and if it doesn't exist it is handled by nconf which throws an error\n */\n this.repo = inputContext.repo ?? this.config.get('repo');\n }\n\n stringify(): string {\n if (this?.config) {\n try {\n return YAML.stringify(this.config.get());\n } catch (error) {\n this.log.error(`${error}`);\n // continue\n }\n }\n // this is just for debug, no need to stop the process if it fails\n return '';\n }\n}\n"]}
1
+ {"version":3,"file":"inputs.js","sourceRoot":"","sources":["../../src/inputs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB,MAAM,OAAO,GAAG,aAAa,CAAC,WAAgC,CAAC;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CAAC,GAAG,CAAC,UAAU,CAAqB,CAC1E,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAoB,CAAC;QAC/D,IAAI,CAAC,UAAU;YACb,YAAY,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW,CAAW,CAAC,CAAC;QAC7F,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC,YAAY,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnF;;WAEG;QACH,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;YAC/B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC5C,CAAC;QACD;;WAEG;QACH,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAE5D;;WAEG;QACH,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IAED,SAAS;QACP,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC;gBACH,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;YAC3C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;gBAC3B,WAAW;YACb,CAAC;QACH,CAAC;QACD,kEAAkE;QAClE,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["/**\n * This class handles input configuration and manipulation.\n * It imports various modules and packages for file operations, configuration parsing, and logging.\n * The class has methods for initializing the input configuration, setting default values, and converting the configuration to a string.\n * It also has properties for storing the configuration values, sections, readme path, action instance, and readme editor instance.\n */\nimport * as fs from 'node:fs';\nimport * as path from 'node:path';\n\nimport * as core from '@actions/core';\nimport { context as githubContext } from '@actions/github';\nimport nconf from 'nconf';\nimport YAML from 'yaml';\n\n// Get Context type and constructor from the exported context instance\ntype Context = typeof githubContext;\nconst Context = githubContext.constructor as new () => Context;\n\nimport Action, { type Input } from './Action.js';\nimport { ConfigKeys, configFileName, README_SECTIONS, type ReadmeSection } from './constants.js';\nimport { repositoryFinder } from './helpers.js';\nimport LogTask from './logtask/index.js';\nimport ReadmeEditor from './readme-editor.js';\n\nconst { Provider }: typeof nconf = nconf;\ntype IOptions = nconf.IOptions;\n\n/**\n * Change working directory to output of workingDirectory()\n */\n// process.chdir(workingDirectory());\nexport const metaActionPath = '../../action.yml';\n\nexport type ArgvOptionProperties = {\n [key: string]: {\n alias: string | string[];\n describe: string;\n parseValues?: boolean;\n type?: string;\n };\n};\n/**\n * Represents the command line argument options for the application.\n */\nconst argvOptions: ArgvOptionProperties = {};\n\n/**\n * Save option configuration.\n * @property {string} alias - Alias for the save option.\n * @property {string} describe - Description for the save option.\n * @property {boolean} parseValues - Specifies whether to parse values for the save option.\n * @property {string} type - Type of the save option.\n */\nargvOptions[ConfigKeys.Save] = {\n alias: 'save',\n describe: `Save this config to ${configFileName}`,\n parseValues: true,\n type: 'boolean',\n};\n\n/**\n * Paths action option configuration.\n * @property {string | string[]} alias - Alias(es) for the pathsAction option.\n * @property {string} type - Type of the pathsAction option.\n * @property {string} describe - Description for the pathsAction option.\n */\nargvOptions[ConfigKeys.pathsAction] = {\n alias: ['pathsAction', 'action'],\n type: 'string',\n describe: 'Path to the action.yml',\n};\n\n/**\n * Paths readme option configuration.\n * @property {string | string[]} alias - Alias(es) for the pathsReadme option.\n * @property {string} type - Type of the pathsReadme option.\n * @property {string} describe - Description for the pathsReadme option.\n */\nargvOptions[ConfigKeys.pathsReadme] = {\n alias: ['pathsReadme', 'readme'],\n type: 'string',\n describe: 'Path to the README file',\n};\n\n/**\n * Branding SVG path option configuration.\n * @property {string} alias - Alias for the svg option.\n * @property {string} type - Type of the svg option.\n * @property {string} describe - Description for the svg option.\n */\nargvOptions[ConfigKeys.BrandingSvgPath] = {\n alias: 'svg',\n type: 'string',\n describe: 'Save and load the branding svg image in the README from this path',\n};\n\n/**\n * Branding as title prefix option configuration.\n * @property {string} alias - Alias for the branding_prefix option.\n * @property {string} type - Type of the branding_prefix option.\n * @property {boolean} parseValues - Specifies whether to parse values for the branding_prefix option.\n * @property {string} describe - Description for the branding_prefix option.\n */\nargvOptions[ConfigKeys.BrandingAsTitlePrefix] = {\n alias: 'branding_prefix',\n type: 'boolean',\n parseValues: true,\n describe: 'Use the branding svg as a prefix for the README title',\n};\n\n/**\n * Owner option configuration.\n * @property {string} alias - Alias for the owner option.\n * @property {string} type - Type of the owner option.\n * @property {string} describe - Description for the owner option.\n */\nargvOptions[ConfigKeys.Owner] = {\n alias: 'owner',\n type: 'string',\n describe: 'The GitHub Action repository owner. i.e: `bitflight-devops`',\n};\n\n/**\n * Repo option configuration.\n * @property {string} alias - Alias for the repo option.\n * @property {string} type - Type of the repo option.\n * @property {string} describe - Description for the repo option.\n */\nargvOptions[ConfigKeys.Repo] = {\n alias: 'repo',\n type: 'string',\n describe: 'The GitHub Action repository name. i.e: `github-action-readme-generator`',\n};\n\n/**\n * Prettier option configuration.\n * @property {string | string[]} alias - Alias(es) for the prettier option.\n * @property {string} type - Type of the prettier option.\n * @property {boolean} parseValues - Specifies whether to parse values for the prettier option.\n * @property {string} describe - Description for the prettier option.\n */\nargvOptions[ConfigKeys.Prettier] = {\n alias: ['pretty', 'prettier'],\n type: 'boolean',\n parseValues: true,\n describe: 'Format the markdown using prettier formatter',\n};\n\n/**\n * Versioning enabled option configuration.\n * @property {string | string[]} alias - Alias(es) for the versioning_enabled option.\n * @property {string} describe - Description for the versioning_enabled option.\n * @property {boolean} parseValues - Specifies whether to parse values for the versioning_enabled option.\n * @property {string} type - Type of the versioning_enabled option.\n */\nargvOptions[ConfigKeys.VersioningEnabled] = {\n alias: ['versioning', 'versioning_enabled'],\n describe:\n 'Enable the update of the usage version to match the latest version in the package.json file',\n parseValues: true,\n type: 'boolean',\n};\n\n/**\n * Versioning override option configuration.\n * @property {string | string[]} alias - Alias(es) for the versioning_override option.\n * @property {string} describe - Description for the versioning_override option.\n * @property {boolean} parseValues - Specifies whether to parse values for the versioning_override option.\n */\nargvOptions[ConfigKeys.VersioningOverride] = {\n alias: ['setversion', 'versioning_override', 'version_override'],\n describe: 'Set a specific version to display in the README.md',\n parseValues: true,\n};\n\n/**\n * Versioning prefix option configuration.\n * @property {string | string[]} alias - Alias(es) for the version_prefix option.\n * @property {string} describe - Description for the version_prefix option.\n * @property {boolean} parseValues - Specifies whether to parse values for the version_prefix option.\n */\nargvOptions[ConfigKeys.VersioningPrefix] = {\n alias: ['vp', 'version_prefix'],\n describe: \"Prefix the version with this value (if it isn't already prefixed)\",\n parseValues: true,\n};\n\n/**\n * Versioning branch option configuration.\n * @property {string | string[]} alias - Alias(es) for the versioning_default_branch option.\n * @property {string} describe - Description for the versioning_default_branch option.\n * @property {boolean} parseValues - Specifies whether to parse values for the versioning_default_branch option.\n */\nargvOptions[ConfigKeys.VersioningBranch] = {\n alias: ['branch', 'versioning_default_branch'],\n describe: 'If versioning is disabled show this branch instead',\n parseValues: true,\n};\n\n/**\n * Versioning source option configuration.\n * @property {string | string[]} alias - Alias(es) for the version_source option.\n * @property {string} describe - Description for the version_source option.\n * @property {boolean} parseValues - Specifies whether to parse values for the version_source option.\n * @property {string} type - Type of the version_source option.\n */\nargvOptions[ConfigKeys.VersioningSource] = {\n alias: ['version-source', 'version_source', 'versioning_source'],\n describe:\n 'How to detect the action version (git-tag, git-branch, git-sha, package-json, explicit)',\n parseValues: true,\n type: 'string',\n};\n\n/**\n * Include GitHub version badge option configuration.\n * @property {string | string[]} alias - Alias(es) for the include_github_version_badge option.\n * @property {string} describe - Description for the include_github_version_badge option.\n * @property {boolean} parseValues - Specifies whether to parse values for the include_github_version_badge option.\n * @property {string} type - Type of the include_github_version_badge option.\n */\nargvOptions[ConfigKeys.IncludeGithubVersionBadge] = {\n alias: ['version-badge', 'versioning_badge', 'include_github_version_badge'],\n describe: 'Display the current version as a badge',\n parseValues: true,\n type: 'boolean',\n};\n\n/**\n * Title prefix option configuration.\n * @property {string | string[]} alias - Alias(es) for the title_prefix option.\n * @property {string} describe - Description for the title_prefix option.\n * @property {boolean} parseValues - Specifies whether to parse values for the title_prefix option.\n */\nargvOptions[ConfigKeys.TitlePrefix] = {\n alias: ['prefix', 'title_prefix'],\n describe: 'Add a prefix to the README title',\n parseValues: true,\n};\n\n/**\n * Debug Nconf option configuration.\n * @property {string} describe - Description for the debugNconf option.\n * @property {boolean} parseValues - Specifies whether to parse values for the debugNconf option.\n * @property {string} type - Type of the debugNconf option.\n */\nargvOptions[ConfigKeys.DebugNconf] = {\n alias: ['debug_nconf'],\n describe: 'Print out the resolved nconf object with all values',\n parseValues: true,\n type: 'boolean',\n};\n\n/**\n * Debug Config option configuration.\n * @property {string} describe - Description for the debugConfig option.\n * @property {boolean} parseValues - Specifies whether to parse values for the debugConfig option.\n * @property {string} type - Type of the debugConfig option.\n */\nargvOptions[ConfigKeys.DebugConfig] = {\n alias: ['debug_config'],\n describe: 'Print out the resolved nconf object with all values',\n parseValues: true,\n type: 'boolean',\n};\n\n/**\n * Configuration inputs from the github action don't\n * all match the input names when running on cli.\n * This maps the action inputs to the cli.\n */\nconst ConfigKeysInputsMap: Record<string, string> = {\n save: ConfigKeys.Save,\n action: ConfigKeys.pathsAction,\n readme: ConfigKeys.pathsReadme,\n branding_svg_path: ConfigKeys.BrandingSvgPath,\n branding_as_title_prefix: ConfigKeys.BrandingAsTitlePrefix,\n versioning_enabled: ConfigKeys.VersioningEnabled,\n version_prefix: ConfigKeys.VersioningPrefix,\n versioning_default_branch: ConfigKeys.VersioningBranch,\n version_override: ConfigKeys.VersioningOverride,\n version_source: ConfigKeys.VersioningSource,\n include_github_version_badge: ConfigKeys.IncludeGithubVersionBadge,\n owner: ConfigKeys.Owner,\n repo: ConfigKeys.Repo,\n title_prefix: ConfigKeys.TitlePrefix,\n pretty: ConfigKeys.Prettier,\n};\n\n/**\n * Interface for key/value pair object\n */\ntype KVPairType = {\n key: string;\n value: string | undefined;\n};\n\n/**\n * Type alias for Provider instance\n */\ntype ProviderInstance = InstanceType<typeof Provider>;\n\nexport function transformGitHubInputsToArgv(\n log: LogTask,\n _config: ProviderInstance,\n obj: KVPairType,\n): undefined | KVPairType {\n /** The obj.key is always in lowercase, but it checks for it without case sensitivity */\n if (/^(INPUT|input)_[A-Z_a-z]\\w*$/.test(obj.key)) {\n log.debug(`Parsing input: ${obj.key} with ith value: ${obj.value}`);\n const keyParsed = obj.key.replace(/^(INPUT|input)_/, '').toLocaleLowerCase();\n const key = ConfigKeysInputsMap[keyParsed] || keyParsed;\n\n // Skip empty values for owner/repo to allow fallback detection from .git/config or GITHUB_REPOSITORY\n if ((key === 'owner' || key === 'repo') && (!obj.value || obj.value === '')) {\n log.debug(`Ignoring empty ${key} input to allow auto-detection`);\n return undefined;\n }\n\n log.debug(`New input is ${key} with the value ${obj.value}`);\n return { key, value: obj.value };\n }\n log.debug(`Ignoring input: ${obj.key} with ith value: ${obj.value}`);\n return undefined;\n}\n\n/**\n * Sets config value from action file default\n *\n * @param {Action} actionInstance - The action instance\n * @param {string} inputName - The input name\n * @returns {string | boolean | undefined} The default value\n */\nexport function setConfigValueFromActionFileDefault(\n log: LogTask,\n actionInstance: Action,\n inputName: string,\n): string | boolean | undefined {\n if (ConfigKeysInputsMap[inputName] === undefined) {\n log.error(\n `${inputName} from ${\n actionInstance.path\n } does not match a known input. Known inputs are: ${Object.keys(ConfigKeysInputsMap)}`,\n );\n return;\n }\n\n const configName = ConfigKeysInputsMap[inputName];\n const defaultValue = actionInstance.inputDefault(inputName);\n\n log.debug(`Default Value for action.yml: ${inputName} CLI: ${configName} = ${defaultValue}`);\n\n return defaultValue;\n}\n\n/**\n * Collects all default values from action file\n *\n * @returns {IOptions} The default values object\n */\nexport function collectAllDefaultValuesFromAction(\n log: LogTask,\n providedMetaActionPath?: string,\n providedDefaults: {\n [key: string]: Input;\n } = {},\n): IOptions {\n log.debug('Collecting default values from action.yml');\n // This loads the defaults from THIS action's own action.yml file (github-action-readme-generator's action.yml)\n // NOT the user's action.yml file (which is loaded separately via the 'action' input parameter)\n // Therefore, we use import.meta.dirname to find this package's action.yml regardless of where it's installed\n const thisActionPath = path.join(import.meta.dirname, providedMetaActionPath ?? metaActionPath);\n try {\n const defaultValues = {} as IOptions;\n const thisAction = new Action(thisActionPath);\n const defaults: {\n [key: string]: Input;\n } = { ...thisAction.inputs, ...providedDefaults };\n // Collect all of the default values from the action.yml file\n if (defaults) {\n for (const key of Object.keys(defaults)) {\n const mappedKey = ConfigKeysInputsMap[key] ?? key;\n defaultValues[mappedKey] = setConfigValueFromActionFileDefault(log, thisAction, key);\n }\n }\n log.debug(JSON.stringify(defaultValues, null, 2));\n return defaultValues;\n } catch (error) {\n // When running as a CLI tool (e.g., via npx or yarn dlx), the tool's own action.yml\n // may not be present in the node_modules. This is expected behavior, as the tool\n // should still work to generate documentation for other actions.\n log.debug(`Could not load defaults from this tool's action.yml at ${thisActionPath}: ${error}`);\n log.debug('Continuing without default values from action.yml');\n return {} as IOptions;\n }\n}\n\n/**\n * Loads the configuration\n *\n * @returns {ProviderInstance} The configuration instance\n */\nexport function loadConfig(\n log: LogTask,\n providedConfig?: ProviderInstance,\n configFilePath?: string,\n): ProviderInstance {\n log.debug('Loading config from env and argv');\n const config = providedConfig ?? new Provider();\n if (process.env.GITHUB_ACTION === 'true') {\n log.info('Running in GitHub action');\n }\n if (configFilePath) {\n if (fs.existsSync(configFilePath)) {\n log.info(`Config file found: ${configFilePath}`);\n config.file(configFilePath);\n } else {\n log.debug(`Config file not found: ${configFilePath}`);\n }\n }\n\n config\n .env({\n lowerCase: true,\n parseValues: true,\n transform: (obj: KVPairType): undefined | KVPairType => {\n return transformGitHubInputsToArgv(log, config, obj);\n },\n })\n .argv(argvOptions);\n\n return config;\n}\n\n/**\n * Loads the default configuration\n *\n * @param {ProviderInstance} config - The config instance\n * @returns {ProviderInstance} The updated config instance\n */\nexport function loadDefaultConfig(\n log: LogTask,\n config: ProviderInstance,\n providedContext?: Context,\n): ProviderInstance {\n log.debug('Loading default config');\n const defaultValues = collectAllDefaultValuesFromAction(log);\n const context = providedContext ?? new Context();\n\n // Get owner/repo from config (which includes CLI args), falling back to env vars for GitHub Actions\n const ownerFromConfig = config.get('owner') as string | undefined;\n const repoFromConfig = config.get('repo') as string | undefined;\n const ownerInput = ownerFromConfig ?? process.env.INPUT_OWNER ?? '';\n const repoInput = repoFromConfig ?? process.env.INPUT_REPO ?? '';\n\n // Get the action path to derive the target repo directory for .git/config lookup\n const actionPath = config.get(ConfigKeys.pathsAction) as string | undefined;\n const actionDir = actionPath ? path.dirname(path.resolve(actionPath)) : undefined;\n log.debug(`Action directory for repository detection: ${actionDir ?? 'not specified'}`);\n\n const repositoryDetail = repositoryFinder(`${ownerInput}/${repoInput}`, context, actionDir);\n log.debug(`repositoryDetail: ${repositoryDetail}`);\n // Apply the default values from the action.yml file\n return config.defaults({\n ...defaultValues,\n owner: repositoryDetail?.owner,\n repo: repositoryDetail?.repo,\n sections: [...README_SECTIONS] as ReadmeSection[],\n });\n}\n\n/**\n * Represents the required inputs for the action.\n */\nconst RequiredInputs = [\n ConfigKeys.pathsAction,\n ConfigKeys.pathsReadme,\n ConfigKeys.Owner,\n ConfigKeys.Repo,\n] as const;\n\n/**\n * Loads the required configuration\n *\n * @param {ProviderInstance} config - The config instance\n * @returns {ProviderInstance} The updated config instance\n */\nexport function loadRequiredConfig(\n log: LogTask,\n config: ProviderInstance,\n requiredInputs: readonly string[] = RequiredInputs,\n): ProviderInstance {\n log.debug('Loading required config');\n\n return config.required([...requiredInputs]);\n}\n\n/**\n *\n */\nexport function loadAction(log: LogTask, actionPath: string): Action {\n log.debug(`Loading action from: ${actionPath}`);\n if (actionPath) {\n return new Action(path.resolve(actionPath));\n }\n throw new Error(`Action path not found: ${actionPath}`);\n}\n\nexport type InputContext = {\n /**\n * The configuration instance\n */\n config?: ProviderInstance;\n\n /**\n * The readme sections\n */\n sections?: ReadmeSection[];\n\n /**\n * The readme file path\n */\n readmePath?: string;\n\n /**\n * The config file path\n */\n configPath?: string;\n\n /**\n * The action instance\n */\n action?: Action;\n\n /**\n * The readme editor instance\n */\n readmeEditor?: ReadmeEditor;\n\n /**\n * The repository owner\n */\n owner?: string;\n\n /**\n * The repository name\n */\n repo?: string;\n};\n/**\n * Main Inputs class that handles configuration\n */\nexport default class Inputs {\n /**\n * The configuration instance\n */\n config: ProviderInstance;\n\n /**\n * The readme sections\n */\n sections: ReadmeSection[];\n\n /**\n * The readme file path\n */\n readmePath: string;\n\n /**\n * The config file path\n */\n configPath: string;\n\n /**\n * The action instance\n */\n action: Action;\n\n /**\n * The readme editor instance\n */\n readmeEditor: ReadmeEditor;\n\n /**\n * The repository owner\n */\n owner: string;\n\n /**\n * The repository name\n */\n repo: string;\n\n /** The logger for this instance */\n log: LogTask;\n\n /**\n * Initializes a new instance of the Inputs class.\n */\n constructor(providedInputContext: InputContext = {}, log: LogTask = new LogTask('inputs')) {\n this.log = log ?? new LogTask('inputs');\n this.log.debug('Initializing Inputs');\n const inputContext = providedInputContext ?? {};\n this.configPath = inputContext.configPath ?? path.resolve(configFileName);\n this.config = inputContext.config ?? new Provider();\n loadConfig(log, this.config, this.configPath);\n loadDefaultConfig(log, this.config);\n loadRequiredConfig(log, this.config);\n\n this.action = inputContext.action ?? loadAction(log, this.config.get(ConfigKeys.pathsAction));\n this.config.set(\n 'sections',\n inputContext.sections ?? (this.config.get('sections') as ReadmeSection[]),\n );\n this.sections = this.config.get('sections') as ReadmeSection[];\n this.readmePath =\n inputContext.readmePath ?? path.resolve(this.config.get(ConfigKeys.pathsReadme) as string);\n this.readmeEditor = inputContext.readmeEditor ?? new ReadmeEditor(this.readmePath);\n /**\n * Output the readme path that is being parsed\n */\n if (process.env.GITHUB_ACTIONS) {\n core.setOutput('readme', this.readmePath);\n }\n /**\n * owner is required, and if it doesn't exist it is handled by nconf which throws an error\n */\n this.owner = inputContext.owner ?? this.config.get('owner');\n\n /**\n * repo is required, and if it doesn't exist it is handled by nconf which throws an error\n */\n this.repo = inputContext.repo ?? this.config.get('repo');\n }\n\n stringify(): string {\n if (this?.config) {\n try {\n return YAML.stringify(this.config.get());\n } catch (error) {\n this.log.error(`${error}`);\n // continue\n }\n }\n // this is just for debug, no need to stop the process if it fails\n return '';\n }\n}\n"]}
@@ -448,8 +448,10 @@ declare module "src/readme-editor" {
448
448
  }
449
449
  }
450
450
  declare module "src/inputs" {
451
- import { Context } from '@actions/github/lib/context.js';
451
+ import { context as githubContext } from '@actions/github';
452
452
  import nconf from 'nconf';
453
+ type Context = typeof githubContext;
454
+ const Context: new () => Context;
453
455
  import Action, { type Input } from "src/Action";
454
456
  import { type ReadmeSection } from "src/constants";
455
457
  import LogTask from "src/logtask/index";
@@ -603,10 +605,11 @@ declare module "src/unicode-word-match" {
603
605
  export const unicodeWordMatch: RegExp;
604
606
  }
605
607
  declare module "src/helpers" {
606
- import type { Context } from '@actions/github/lib/context.js';
608
+ import { context } from '@actions/github';
607
609
  import type Inputs from "src/inputs";
608
610
  import LogTask from "src/logtask/index";
609
611
  import { type Nullable } from "src/util";
612
+ type Context = typeof context;
610
613
  /**
611
614
  * Returns the input value if it is not empty, otherwise returns undefined.
612
615
  * @param value - The input value to check.
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.10.1",
4
+ "version": "1.10.2",
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",
@@ -146,7 +146,7 @@
146
146
  },
147
147
  "dependencies": {
148
148
  "@actions/core": "^2.0.1",
149
- "@actions/github": "^7.0.0",
149
+ "@actions/github": "^9.0.0",
150
150
  "@svgdotjs/svg.js": "^3.2.5",
151
151
  "@types/feather-icons": "^4.29.4",
152
152
  "@types/svgdom": "^0.1.2",
@@ -172,7 +172,7 @@
172
172
  "commitizen": "^4.3.1",
173
173
  "conventional-commits": "^1.6.0",
174
174
  "cz-conventional-changelog": "^3.3.0",
175
- "dotenv": "^16.3.1",
175
+ "dotenv": "^17.2.4",
176
176
  "esbuild": "^0.27.2",
177
177
  "esbuild-node-externals": "^1.20.1",
178
178
  "husky": "^9.1.7",