Skip to content

Commit d427ae6

Browse files
committed
fix: restrict patched version to v1
1 parent 1cc4e00 commit d427ae6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/version.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ type Config = {
110110
}
111111
}
112112

113-
const getConfig = async (): Promise<Config> => {
113+
const fetchConfig = async (): Promise<Config> => {
114114
const http = new httpm.HttpClient(`golangci/golangci-lint-action`, [], {
115115
allowRetries: true,
116116
maxRetries: 5,
@@ -143,7 +143,7 @@ export async function findLintVersion(mode: InstallMode): Promise<VersionConfig>
143143
const reqLintVersion = getRequestedLintVersion()
144144

145145
// if the patched version is passed, just use it
146-
if (reqLintVersion?.major !== null && reqLintVersion?.minor != null && reqLintVersion?.patch !== null) {
146+
if (reqLintVersion?.major === 1 && reqLintVersion?.minor != null && reqLintVersion?.patch !== null) {
147147
return new Promise((resolve) => {
148148
let arch: string = "amd64"
149149
if (os.arch() === "arm64") {
@@ -159,7 +159,7 @@ export async function findLintVersion(mode: InstallMode): Promise<VersionConfig>
159159

160160
const startedAt = Date.now()
161161

162-
const config = await getConfig()
162+
const config = await fetchConfig()
163163
if (!config.MinorVersionToConfig) {
164164
core.warning(JSON.stringify(config))
165165
throw new Error(`invalid config: no MinorVersionToConfig field`)

0 commit comments

Comments
 (0)