From d427ae60629a45df85891c99799a37e3c8e4eba5 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sun, 9 Feb 2025 01:09:26 +0100 Subject: [PATCH] fix: restrict patched version to v1 --- src/version.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/version.ts b/src/version.ts index 03e1a6d..d49f35b 100644 --- a/src/version.ts +++ b/src/version.ts @@ -110,7 +110,7 @@ type Config = { } } -const getConfig = async (): Promise => { +const fetchConfig = async (): Promise => { const http = new httpm.HttpClient(`golangci/golangci-lint-action`, [], { allowRetries: true, maxRetries: 5, @@ -143,7 +143,7 @@ export async function findLintVersion(mode: InstallMode): Promise const reqLintVersion = getRequestedLintVersion() // if the patched version is passed, just use it - if (reqLintVersion?.major !== null && reqLintVersion?.minor != null && reqLintVersion?.patch !== null) { + if (reqLintVersion?.major === 1 && reqLintVersion?.minor != null && reqLintVersion?.patch !== null) { return new Promise((resolve) => { let arch: string = "amd64" if (os.arch() === "arm64") { @@ -159,7 +159,7 @@ export async function findLintVersion(mode: InstallMode): Promise const startedAt = Date.now() - const config = await getConfig() + const config = await fetchConfig() if (!config.MinorVersionToConfig) { core.warning(JSON.stringify(config)) throw new Error(`invalid config: no MinorVersionToConfig field`)