Skip to content

Fix golangci-lint installation #2

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on: [push]

jobs:
test_action:
runs-on: ubuntu-latest
name: Test this action
steps:
- name: Test action
id: test-action
uses: nickhstr/[email protected]
with:
version: 1.24.0

- name: Validate
run: golangci-lint --version
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ golangci-lint is downloaded and added to the tools cache for reuse across jobs/s

## Inputs
Only one input is needed: `version`. This must be a semantic version, matching a released version of golangci-lint.

## Example usage

```yaml
uses: nickhstr/[email protected]
with:
version: 1.24.0
```
9 changes: 8 additions & 1 deletion src/installer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');
const core = require('@actions/core');
const tc = require('@actions/tool-cache');
const io = require('@actions/io');

const toolName = 'golangci-lint';

Expand All @@ -23,8 +24,14 @@ async function installer(version) {
core.debug(`${toolName} is cached under ${toolPath}`);
}

// Tool will be extracted in a directory with the compressed file name
toolRoot = path.join(toolPath, `golangci-lint-${version}-linux-amd64`)

// Add golangci-lint dir to bin
core.addPath(toolPath);
core.addPath(toolRoot);

let g = await io.which('golangci-lint', true);
core.debug(`which golangci-lint: ${g}`)
}

/**
Expand Down