Skip to content

Commit

Permalink
Merge pull request #10 from golangci/feature/fix-github-token
Browse files Browse the repository at this point in the history
docs: recommend using GITHUB_TOKEN
  • Loading branch information
jirfag authored May 7, 2020
2 parents 1ad27ad + fc9d172 commit 1ef31b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
with:
version: v1.26
args: --issues-exit-code=0 ./sample/...
github-token: ${{ secrets.GOLANGCI_LINT_GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ The action runs [golangci-lint](https://github.com/golangci/golangci-lint) and r

## How to use

1. Create a [GitHub token](https://github.com/settings/tokens/new) with scope `repo.public_repo`.
2. Add it to a [repository secrets](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets): repository -> `Settings` -> `Secrets`.
3. Add `.github/workflows/golangci-lint.yml` with the following contents:
Add `.github/workflows/golangci-lint.yml` with the following contents:

```yaml
name: golangci-lint
Expand All @@ -37,8 +35,11 @@ jobs:
# Optional: golangci-lint command line arguments.
# args: ./the-only-dir-to-analyze/...

# Required: GitHub token with scope `repo.public_repo`. Used for fetching a list of releases of golangci-lint.
github-token: ${{ secrets.GOLANGCI_LINT_GITHUB_TOKEN }}
# 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 @@ -95,6 +96,5 @@ This scheme is basic and needs improvements. Pull requests and ideas are welcome

1. Install [act](https://github.com/nektos/act#installation)
2. Make a symlink for `act` to work properly: `ln -s . golangci-lint-action`
3. Get a [GitHub token](https://github.com/settings/tokens/new) with the scope `repo.public_repo`. Export it by `export GITHUB_TOKEN=YOUR_TOKEN`.
4. Prepare deps once: `npm run prepare-deps`
5. Run `npm run local` after any change to test it
3. Prepare deps once: `npm run prepare-deps`
4. Run `npm run local` after any change to test it

0 comments on commit 1ef31b6

Please sign in to comment.