chore: simplify

This commit is contained in:
Fernandez Ludovic
2025-11-09 10:03:39 +01:00
parent 0a35821d5c
commit c7c1219093
3 changed files with 12 additions and 9 deletions

7
dist/run/index.js generated vendored
View File

@@ -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 = ".";