Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: golangci/golangci-lint-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.7.0
Choose a base ref
...
head repository: golangci/golangci-lint-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.7.1
Choose a head ref

Commits on Aug 18, 2023

  1. Copy the full SHA
    6efbbad View commit details

Commits on Aug 21, 2023

  1. Copy the full SHA
    1330ad3 View commit details
  2. Copy the full SHA
    f8a3dc1 View commit details
  3. Copy the full SHA
    b2f426b View commit details

Commits on Aug 22, 2023

  1. Copy the full SHA
    81871bc View commit details
  2. Copy the full SHA
    c49c2af View commit details

Commits on Aug 28, 2023

  1. Copy the full SHA
    cf67095 View commit details
  2. Copy the full SHA
    1e9c424 View commit details
  3. Copy the full SHA
    2d891f8 View commit details
  4. Copy the full SHA
    fef6a0f View commit details
  5. Copy the full SHA
    237bd9f View commit details

Commits on Sep 4, 2023

  1. Copy the full SHA
    239c8da View commit details
  2. Copy the full SHA
    f7b4bdd View commit details
  3. Copy the full SHA
    953db97 View commit details
  4. Copy the full SHA
    2d06cf1 View commit details
  5. Copy the full SHA
    29052a9 View commit details

Commits on Sep 6, 2023

  1. Copy the full SHA
    c674166 View commit details

Commits on Sep 11, 2023

  1. Copy the full SHA
    1afd74c View commit details
  2. Copy the full SHA
    d66278f View commit details
  3. Copy the full SHA
    846e7dd View commit details
  4. Copy the full SHA
    d735dc0 View commit details
  5. Copy the full SHA
    c624d54 View commit details
  6. Copy the full SHA
    5f5f252 View commit details

Commits on Sep 18, 2023

  1. Copy the full SHA
    31eb4ea View commit details
  2. Copy the full SHA
    31c1b1a View commit details
  3. Copy the full SHA
    c8d4ef2 View commit details
  4. Copy the full SHA
    031ba7f View commit details
  5. build(deps): bump @actions/core from 1.10.0 to 1.10.1 (#856)

    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    dependabot[bot] and ldez authored Sep 18, 2023
    Copy the full SHA
    c12092e View commit details

Commits on Sep 25, 2023

  1. Copy the full SHA
    a24255b View commit details
  2. Copy the full SHA
    6f4d254 View commit details
  3. Copy the full SHA
    9df6f48 View commit details
  4. Copy the full SHA
    07341d3 View commit details

Commits on Oct 2, 2023

  1. Copy the full SHA
    252bd8e View commit details
  2. Copy the full SHA
    507ec96 View commit details
  3. Copy the full SHA
    526ce23 View commit details
  4. Copy the full SHA
    e09eda3 View commit details

Commits on Oct 9, 2023

  1. Copy the full SHA
    5545aac View commit details
  2. Copy the full SHA
    a625c15 View commit details
  3. Copy the full SHA
    84072ff View commit details
  4. Copy the full SHA
    62f9676 View commit details
  5. build(deps): bump @actions/http-client from 2.1.1 to 2.2.0 (#872)

    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    dependabot[bot] and ldez authored Oct 9, 2023
    Copy the full SHA
    9cb5ef7 View commit details

Commits on Oct 16, 2023

  1. Copy the full SHA
    40776d7 View commit details
  2. Copy the full SHA
    c8710f2 View commit details
  3. Copy the full SHA
    a555e8c View commit details
  4. Copy the full SHA
    30416f0 View commit details
  5. build(deps): bump @actions/github from 5.1.1 to 6.0.0 (#877)

    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    dependabot[bot] and ldez authored Oct 16, 2023
    Copy the full SHA
    5a72764 View commit details
  6. build(deps): bump undici from 5.25.4 to 5.26.3 (#879)

    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    dependabot[bot] and ldez authored Oct 16, 2023
    Copy the full SHA
    4b1e98b View commit details

Commits on Oct 23, 2023

  1. Copy the full SHA
    d27d0c2 View commit details
  2. Copy the full SHA
    31c68b6 View commit details
  3. Copy the full SHA
    b45661b View commit details
Showing with 75,939 additions and 27,284 deletions.
  1. +3 −3 .github/workflows/codeql.yaml
  2. +8 −8 .github/workflows/test.yml
  3. +24 −12 README.md
  4. +1 −1 action.yml
  5. +37,468 −13,239 dist/post_run/index.js
  6. +37,468 −13,239 dist/run/index.js
  7. +951 −766 package-lock.json
  8. +16 −16 package.json
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head of the pull request.
@@ -31,7 +31,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
# Override language selection by uncommenting this and choosing your languages
with:
language: 'javascript'
@@ -41,4 +41,4 @@ jobs:
npm run all
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- if: ${{ !(github.event_name == 'pull_request' && (github.event.pull_request.user.id == 49699333 || contains(github.event.pull_request.labels.*.name, 'dependencies'))) }}
uses: actions/checkout@v3
uses: actions/checkout@v4
- if: github.event_name == 'pull_request' && (github.event.pull_request.user.id == 49699333 || contains(github.event.pull_request.labels.*.name, 'dependencies'))
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
@@ -59,8 +59,8 @@ jobs:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
cache: false # setup-go v4 caches by default
- uses: ./
@@ -87,8 +87,8 @@ jobs:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
cache: false # setup-go v4 caches by default
- uses: ./
@@ -110,8 +110,8 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
cache: false # setup-go v4 caches by default
- uses: ./
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -41,15 +41,15 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.53
version: v1.54

# Optional: working directory, useful for monorepos
# working-directory: somedir
@@ -82,7 +82,7 @@ because different jobs [run in parallel](https://help.github.com/en/actions/gett

### Multiple OS Support

If you need to run linters for specific operating systems, you will need to use `v2` of the action. Here is a sample configuration file:
If you need to run linters for specific operating systems, you will need to use the action `>=v2`. Here is a sample configuration file:

```yaml
name: golangci-lint
@@ -102,7 +102,7 @@ jobs:
golangci:
strategy:
matrix:
go: ['1.20']
go: ['1.21']
os: [macos-latest, windows-latest]
name: lint
runs-on: ${{ matrix.os }}
@@ -118,7 +118,7 @@ jobs:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.53
version: v1.54

# Optional: working directory, useful for monorepos
# working-directory: somedir
@@ -136,28 +136,40 @@ jobs:
# install-mode: "goinstall"
```

You will also likely need to add the following `.gitattributes` file to ensure that line endings for windows builds are properly formatted:
You will also likely need to add the following `.gitattributes` file to ensure that line endings for Windows builds are properly formatted:

```.gitattributes
*.go text eol=lf
```

## Comments and Annotations

Currently, GitHub parses the action's output and creates [annotations](https://github.community/t5/GitHub-Actions/What-are-annotations/td-p/30770).
Currently, GitHub parses the action's output and creates [annotations](https://github.blog/2018-12-14-introducing-check-runs-and-annotations/).

The restrictions of annotations are the following:

1. Currently, they don't support markdown formatting (see the [feature request](https://github.community/t5/GitHub-API-Development-and/Checks-Ability-to-include-Markdown-in-line-annotations/m-p/56704))
2. They aren't shown in list of comments like it was with [golangci.com](https://golangci.com). If you would like to have comments - please, up-vote [the issue](https://github.com/golangci/golangci-lint-action/issues/5).
2. They aren't shown in the list of comments like it was with [golangci.com](https://golangci.com). If you would like to have comments - please, up-vote [the issue](https://github.com/golangci/golangci-lint-action/issues/5).

To enable annotations, you need to add the `checks' permission to your action.

```yaml annotate
permissions:
# Required: allow read access to the content for analysis.
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
# Optional: Allow write access to checks to allow the action to annotate code in the PR.
checks: write
```
## Performance
The action was implemented with performance in mind:
1. We cache data by [@actions/cache](https://github.com/actions/toolkit/tree/master/packages/cache) between builds: Go build cache, Go modules cache, golangci-lint analysis cache.
2. We don't use Docker because image pulling is slow.
3. We do as much as we can in parallel, e.g. we download cache, go and golangci-lint binary in parallel.
3. We do as much as we can in parallel, e.g. we download cache, go, and golangci-lint binary in parallel.
For example, in a repository of [golangci-lint](https://github.com/golangci/golangci-lint) running this action without the cache takes 50s, but with cache takes 14s:
* in parallel:
@@ -172,12 +184,12 @@ We use JavaScript-based action. We don't use Docker-based action because:
1. docker pulling is slow currently
2. it's easier to use caching from [@actions/cache](https://github.com/actions/toolkit/tree/master/packages/cache)

We support different platforms, such as `ubuntu`, `macos` and `windows` with `x32` and `x64` archs.
We support different platforms, such as `ubuntu`, `macos`, and `windows` with `x32` and `x64` archs.

Inside our action we perform 3 steps:
Inside our action, we perform 3 steps:

1. Setup environment running in parallel:
* restore [cache](https://github.com/actions/cache) of previous analyzes
* restore [cache](https://github.com/actions/cache) of previous analyses
* 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)
2. Run `golangci-lint` with specified by user `args`
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ inputs:
default: "binary"
required: false
runs:
using: "node16"
using: "node20"
main: "dist/run/index.js"
post: "dist/post_run/index.js"
branding:
Loading