Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add input asset-url to allow downloading custom-built binaries #676

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down
2 changes: 1 addition & 1 deletion dist/post_run/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down
2 changes: 1 addition & 1 deletion dist/run/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down
2 changes: 1 addition & 1 deletion src/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const getAssetURL = (versionConfig: VersionConfig): string => {
export async function installLint(versionConfig: VersionConfig): Promise<string> {
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 = ""
Expand Down