diff --git a/README.md b/README.md index e93fedc1ea..cc7824efa2 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,9 @@ jobs: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version version: v1.29 + # Optional: URL of a custom golangci-lint build to use. If not provided, an asset will be automatically chosen from the official repo. + asset-url: https://example.com/golangci-lint/release.tgz + # Optional: working directory, useful for monorepos # working-directory: somedir diff --git a/action.yml b/action.yml index 3e5d74d4d0..a888406c5a 100644 --- a/action.yml +++ b/action.yml @@ -5,6 +5,9 @@ inputs: version: description: "version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version" required: false + asset-url: + description: "custom URL for a golangci-lint archive to download and install. Must match the OS/arch of the build agent." + required: false args: description: "golangci-lint command line arguments" default: "" diff --git a/dist/post_run/index.js b/dist/post_run/index.js index b3f81b6c55..eb09d8e88c 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -67685,7 +67685,7 @@ function installLint(versionConfig) { return __awaiter(this, void 0, void 0, function* () { core.info(`Installing golangci-lint ${versionConfig.TargetVersion}...`); const startedAt = Date.now(); - const assetURL = getAssetURL(versionConfig); + const assetURL = core.getInput('asset-url') || getAssetURL(versionConfig); core.info(`Downloading ${assetURL} ...`); const archivePath = yield tc.downloadTool(assetURL); let extractedDir = ""; diff --git a/dist/run/index.js b/dist/run/index.js index b7a245f13a..87b53c39ca 100644 --- a/dist/run/index.js +++ b/dist/run/index.js @@ -67685,7 +67685,7 @@ function installLint(versionConfig) { return __awaiter(this, void 0, void 0, function* () { core.info(`Installing golangci-lint ${versionConfig.TargetVersion}...`); const startedAt = Date.now(); - const assetURL = getAssetURL(versionConfig); + const assetURL = core.getInput('asset-url') || getAssetURL(versionConfig); core.info(`Downloading ${assetURL} ...`); const archivePath = yield tc.downloadTool(assetURL); let extractedDir = ""; diff --git a/src/install.ts b/src/install.ts index b854030b78..ab4ec03772 100644 --- a/src/install.ts +++ b/src/install.ts @@ -35,7 +35,7 @@ const getAssetURL = (versionConfig: VersionConfig): string => { export async function installLint(versionConfig: VersionConfig): Promise { core.info(`Installing golangci-lint ${versionConfig.TargetVersion}...`) const startedAt = Date.now() - const assetURL = getAssetURL(versionConfig) + const assetURL = core.getInput('asset-url') || getAssetURL(versionConfig) core.info(`Downloading ${assetURL} ...`) const archivePath = await tc.downloadTool(assetURL) let extractedDir = ""