mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-14 23:11:14 +00:00
chore: use new assets file
This commit is contained in:
parent
5421a116d2
commit
31530f7ca3
1 changed files with 5 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ const modVersionRe = /github.com\/golangci\/golangci-lint\s(v.+)/
|
|||
|
||||
const parseVersion = (s: string): Version => {
|
||||
if (s == "latest" || s == "") {
|
||||
// TODO(ldez): it should be replaced with an explicit version (ex: v1.64.0)
|
||||
return null
|
||||
}
|
||||
|
||||
|
|
@ -40,6 +41,7 @@ export const stringifyVersion = (v: Version): string => {
|
|||
return `v${v.major}.${v.minor}${v.patch !== null ? `.${v.patch}` : ``}`
|
||||
}
|
||||
|
||||
// TODO(ldez): it should be updated to v2.0.0.
|
||||
const minVersion = {
|
||||
major: 1,
|
||||
minor: 28,
|
||||
|
|
@ -114,7 +116,8 @@ const getConfig = async (): Promise<Config> => {
|
|||
maxRetries: 5,
|
||||
})
|
||||
try {
|
||||
const url = `https://raw.githubusercontent.com/golangci/golangci-lint/master/assets/github-action-config.json`
|
||||
// TODO(ldez): HEAD should be replaced with an explicit version (ex: v1.64.0).
|
||||
const url = `https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/assets/github-action-config-v1.json`
|
||||
const response: httpm.HttpClientResponse = await http.get(url)
|
||||
if (response.message.statusCode !== 200) {
|
||||
throw new Error(`failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`)
|
||||
|
|
@ -132,6 +135,7 @@ export async function findLintVersion(mode: InstallMode): Promise<VersionConfig>
|
|||
|
||||
if (mode == InstallMode.GoInstall) {
|
||||
const v: string = core.getInput(`version`)
|
||||
// TODO(ldez): latest should be replaced with an explicit version (ex: v1.64.0)
|
||||
return { TargetVersion: v ? v : "latest", AssetURL: "github.com/golangci/golangci-lint" }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue