mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-12 14:01:14 +00:00
chore: simplify
This commit is contained in:
parent
0a35821d5c
commit
c7c1219093
3 changed files with 12 additions and 9 deletions
7
dist/post_run/index.js
generated
vendored
7
dist/post_run/index.js
generated
vendored
|
|
@ -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
7
dist/run/index.js
generated
vendored
|
|
@ -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 = ".";
|
||||||
|
|
|
||||||
|
|
@ -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})`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue