mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-12 14:01:14 +00:00
chore: generate
This commit is contained in:
parent
0dde2d62b4
commit
b8bd766d90
2 changed files with 44 additions and 0 deletions
22
dist/post_run/index.js
generated
vendored
22
dist/post_run/index.js
generated
vendored
|
|
@ -97912,6 +97912,10 @@ const isLessVersion = (a, b) => {
|
|||
};
|
||||
const getRequestedVersion = () => {
|
||||
let requestedVersion = core.getInput(`version`);
|
||||
let versionFilePath = core.getInput(`version-file`);
|
||||
if (requestedVersion && versionFilePath) {
|
||||
core.warning(`Both version (${requestedVersion}) and version-file (${versionFilePath}) inputs are specified, only version will be used`);
|
||||
}
|
||||
const workingDirectory = core.getInput(`working-directory`);
|
||||
let goMod = "go.mod";
|
||||
if (workingDirectory) {
|
||||
|
|
@ -97925,6 +97929,24 @@ const getRequestedVersion = () => {
|
|||
core.info(`Found golangci-lint version '${requestedVersion}' in '${goMod}' file`);
|
||||
}
|
||||
}
|
||||
if (requestedVersion == "" && versionFilePath) {
|
||||
if (workingDirectory) {
|
||||
versionFilePath = path_1.default.join(workingDirectory, versionFilePath);
|
||||
}
|
||||
if (!fs.existsSync(versionFilePath)) {
|
||||
throw new Error(`The specified golangci-lint version file at: ${versionFilePath} does not exist`);
|
||||
}
|
||||
const content = fs.readFileSync(versionFilePath, "utf-8");
|
||||
if (path_1.default.basename(versionFilePath) === ".tool-versions") {
|
||||
// asdf/mise file.
|
||||
const match = content.match(/^golangci-lint\s+([^\n#]+)/m);
|
||||
requestedVersion = match ? "v" + match[1].trim().replace(/^v/gi, "") : "";
|
||||
}
|
||||
else {
|
||||
// .golangci-lint-version file.
|
||||
requestedVersion = "v" + content.trim().replace(/^v/gi, "");
|
||||
}
|
||||
}
|
||||
const parsedRequestedVersion = parseVersion(requestedVersion);
|
||||
if (parsedRequestedVersion == null) {
|
||||
return null;
|
||||
|
|
|
|||
22
dist/run/index.js
generated
vendored
22
dist/run/index.js
generated
vendored
|
|
@ -97912,6 +97912,10 @@ const isLessVersion = (a, b) => {
|
|||
};
|
||||
const getRequestedVersion = () => {
|
||||
let requestedVersion = core.getInput(`version`);
|
||||
let versionFilePath = core.getInput(`version-file`);
|
||||
if (requestedVersion && versionFilePath) {
|
||||
core.warning(`Both version (${requestedVersion}) and version-file (${versionFilePath}) inputs are specified, only version will be used`);
|
||||
}
|
||||
const workingDirectory = core.getInput(`working-directory`);
|
||||
let goMod = "go.mod";
|
||||
if (workingDirectory) {
|
||||
|
|
@ -97925,6 +97929,24 @@ const getRequestedVersion = () => {
|
|||
core.info(`Found golangci-lint version '${requestedVersion}' in '${goMod}' file`);
|
||||
}
|
||||
}
|
||||
if (requestedVersion == "" && versionFilePath) {
|
||||
if (workingDirectory) {
|
||||
versionFilePath = path_1.default.join(workingDirectory, versionFilePath);
|
||||
}
|
||||
if (!fs.existsSync(versionFilePath)) {
|
||||
throw new Error(`The specified golangci-lint version file at: ${versionFilePath} does not exist`);
|
||||
}
|
||||
const content = fs.readFileSync(versionFilePath, "utf-8");
|
||||
if (path_1.default.basename(versionFilePath) === ".tool-versions") {
|
||||
// asdf/mise file.
|
||||
const match = content.match(/^golangci-lint\s+([^\n#]+)/m);
|
||||
requestedVersion = match ? "v" + match[1].trim().replace(/^v/gi, "") : "";
|
||||
}
|
||||
else {
|
||||
// .golangci-lint-version file.
|
||||
requestedVersion = "v" + content.trim().replace(/^v/gi, "");
|
||||
}
|
||||
}
|
||||
const parsedRequestedVersion = parseVersion(requestedVersion);
|
||||
if (parsedRequestedVersion == null) {
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue