Skip to content

use action config, don't require github token #13

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

Merged
merged 1 commit into from
May 9, 2020
Merged
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
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ jobs:
npm install
npm run prepare-deps
npm run all
git diff && git diff --cached
git diff --exit-code
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ./
with:
version: v1.26
args: --issues-exit-code=0 ./sample/...
github-token: ${{ secrets.GITHUB_TOKEN }}
args: --issues-exit-code=0 ./sample/...
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v0.1.7
uses: golangci/golangci-lint-action@v0.2.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.26

# Optional: golangci-lint command line arguments.
# args: ./the-only-dir-to-analyze/...

# Required: the token is used for fetching a list of releases of golangci-lint.
# The secret `GITHUB_TOKEN` is automatically created by GitHub,
# no need to create it manually.
# https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#about-the-github_token-secret
github-token: ${{ secrets.GITHUB_TOKEN }}
```

## Comments and Annotations
Expand Down Expand Up @@ -77,8 +71,8 @@ Inside our action we perform 3 steps:

1. Setup environment running in parallel:
* restore [cache](https://github.com/actions/cache) of previous analyzes
* list [releases of golangci-lint](https://github.com/golangci/golangci-lint/releases) and find the latest patch version
for needed version (users of this action can specify only minor version). After that install [golangci-lint](https://github.com/golangci/golangci-lint) using [@actions/tool-cache](https://github.com/actions/toolkit/tree/master/packages/tool-cache)
* fetch [action config](https://github.com/golangci/golangci-lint/blob/master/assets/github-action-config.json) and find the latest `golangci-lint` patch version
for needed version (users of this action can specify only minor version of `golangci-lint`). After that install [golangci-lint](https://github.com/golangci/golangci-lint) using [@actions/tool-cache](https://github.com/actions/toolkit/tree/master/packages/tool-cache)
* install the latest Go 1.x version using [@actions/setup-go](https://github.com/actions/setup-go)
2. Run `golangci-lint` with specified by user `args`
3. Save cache for later builds
Expand Down
Loading