chore: simplify

This commit is contained in:
Fernandez Ludovic 2025-11-09 10:03:39 +01:00
parent 0a35821d5c
commit c7c1219093
No known key found for this signature in database
GPG key ID: 581FF80B781EF668
3 changed files with 12 additions and 9 deletions

7
dist/post_run/index.js generated vendored
View file

@ -97361,8 +97361,9 @@ async function install(binPath) {
else { else {
rootDir = process.cwd(); rootDir = process.cwd();
} }
const configFile = [".custom-gcl.yml", ".custom-gcl.yaml", ".custom-gcl.json"] const configFile = ["yml", "yaml", "json"]
.map((v) => path.join(rootDir, v)) .map((ext) => `.custom-gcl.${ext}`)
.map((filename) => path.join(rootDir, filename))
.find((filePath) => fs.existsSync(filePath)); .find((filePath) => fs.existsSync(filePath));
if (!configFile || configFile === "") { if (!configFile || configFile === "") {
return ""; return "";
@ -97373,7 +97374,7 @@ async function install(binPath) {
const config = yaml_1.default.parse(fs.readFileSync(configFile, "utf-8")); const config = yaml_1.default.parse(fs.readFileSync(configFile, "utf-8"));
const v = core.getInput(`version`); const v = core.getInput(`version`);
if (v !== "" && config.version !== v) { 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) { if (!config.destination) {
config.destination = "."; config.destination = ".";

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

@ -97361,8 +97361,9 @@ async function install(binPath) {
else { else {
rootDir = process.cwd(); rootDir = process.cwd();
} }
const configFile = [".custom-gcl.yml", ".custom-gcl.yaml", ".custom-gcl.json"] const configFile = ["yml", "yaml", "json"]
.map((v) => path.join(rootDir, v)) .map((ext) => `.custom-gcl.${ext}`)
.map((filename) => path.join(rootDir, filename))
.find((filePath) => fs.existsSync(filePath)); .find((filePath) => fs.existsSync(filePath));
if (!configFile || configFile === "") { if (!configFile || configFile === "") {
return ""; return "";
@ -97373,7 +97374,7 @@ async function install(binPath) {
const config = yaml_1.default.parse(fs.readFileSync(configFile, "utf-8")); const config = yaml_1.default.parse(fs.readFileSync(configFile, "utf-8"));
const v = core.getInput(`version`); const v = core.getInput(`version`);
if (v !== "" && config.version !== v) { 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) { if (!config.destination) {
config.destination = "."; config.destination = ".";

View file

@ -34,8 +34,9 @@ export async function install(binPath: string): Promise<string> {
rootDir = process.cwd() rootDir = process.cwd()
} }
const configFile = [".custom-gcl.yml", ".custom-gcl.yaml", ".custom-gcl.json"] const configFile = ["yml", "yaml", "json"]
.map((v) => path.join(rootDir, v)) .map((ext) => `.custom-gcl.${ext}`)
.map((filename) => path.join(rootDir, filename))
.find((filePath) => fs.existsSync(filePath)) .find((filePath) => fs.existsSync(filePath))
if (!configFile || configFile === "") { if (!configFile || configFile === "") {
@ -53,7 +54,7 @@ export async function install(binPath: string): Promise<string> {
const v: string = core.getInput(`version`) const v: string = core.getInput(`version`)
if (v !== "" && config.version !== v) { if (v !== "" && config.version !== v) {
core.warning( 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})`
) )
} }