From c7c1219093bae1f72610c5fd1a51a674647863f8 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sun, 9 Nov 2025 10:03:39 +0100 Subject: [PATCH] chore: simplify --- dist/post_run/index.js | 7 ++++--- dist/run/index.js | 7 ++++--- src/plugins.ts | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dist/post_run/index.js b/dist/post_run/index.js index 7bff57f..957503d 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -97361,8 +97361,9 @@ async function install(binPath) { else { rootDir = process.cwd(); } - const configFile = [".custom-gcl.yml", ".custom-gcl.yaml", ".custom-gcl.json"] - .map((v) => path.join(rootDir, v)) + const configFile = ["yml", "yaml", "json"] + .map((ext) => `.custom-gcl.${ext}`) + .map((filename) => path.join(rootDir, filename)) .find((filePath) => fs.existsSync(filePath)); if (!configFile || configFile === "") { return ""; @@ -97373,7 +97374,7 @@ async function install(binPath) { const config = yaml_1.default.parse(fs.readFileSync(configFile, "utf-8")); const v = core.getInput(`version`); if (v !== "" && config.version !== v) { - core.warning(`The golangci-lint version (${config.version}) defined inside in ${configFile} does not match the version defined in the action (${v})`); + core.warning(`The golangci-lint version (${config.version}) defined inside ${configFile} does not match the version defined in the action (${v})`); } if (!config.destination) { config.destination = "."; diff --git a/dist/run/index.js b/dist/run/index.js index fc06f8c..073f718 100644 --- a/dist/run/index.js +++ b/dist/run/index.js @@ -97361,8 +97361,9 @@ async function install(binPath) { else { rootDir = process.cwd(); } - const configFile = [".custom-gcl.yml", ".custom-gcl.yaml", ".custom-gcl.json"] - .map((v) => path.join(rootDir, v)) + const configFile = ["yml", "yaml", "json"] + .map((ext) => `.custom-gcl.${ext}`) + .map((filename) => path.join(rootDir, filename)) .find((filePath) => fs.existsSync(filePath)); if (!configFile || configFile === "") { return ""; @@ -97373,7 +97374,7 @@ async function install(binPath) { const config = yaml_1.default.parse(fs.readFileSync(configFile, "utf-8")); const v = core.getInput(`version`); if (v !== "" && config.version !== v) { - core.warning(`The golangci-lint version (${config.version}) defined inside in ${configFile} does not match the version defined in the action (${v})`); + core.warning(`The golangci-lint version (${config.version}) defined inside ${configFile} does not match the version defined in the action (${v})`); } if (!config.destination) { config.destination = "."; diff --git a/src/plugins.ts b/src/plugins.ts index a8b6c67..97a624f 100644 --- a/src/plugins.ts +++ b/src/plugins.ts @@ -34,8 +34,9 @@ export async function install(binPath: string): Promise { rootDir = process.cwd() } - const configFile = [".custom-gcl.yml", ".custom-gcl.yaml", ".custom-gcl.json"] - .map((v) => path.join(rootDir, v)) + const configFile = ["yml", "yaml", "json"] + .map((ext) => `.custom-gcl.${ext}`) + .map((filename) => path.join(rootDir, filename)) .find((filePath) => fs.existsSync(filePath)) if (!configFile || configFile === "") { @@ -53,7 +54,7 @@ export async function install(binPath: string): Promise { const v: string = core.getInput(`version`) if (v !== "" && config.version !== v) { core.warning( - `The golangci-lint version (${config.version}) defined inside in ${configFile} does not match the version defined in the action (${v})` + `The golangci-lint version (${config.version}) defined inside ${configFile} does not match the version defined in the action (${v})` ) }