Compare commits

..

47 Commits

Author SHA1 Message Date
9fae48acfc 7.0.1 2025-05-04 21:50:29 +02:00
16ece5e01d docs: clarify that ’args: --path-mode=abs’ is needed for working-directory (#1230) 2025-05-04 21:41:49 +02:00
a3942e2497 build(deps-dev): bump the dev-dependencies group with 2 updates (#1227) 2025-04-21 13:33:46 +02:00
7ecb048b56 build(deps): bump @types/node from 22.14.0 to 22.14.1 in the dependencies group (#1225) 2025-04-14 13:18:59 +02:00
63a0d0e695 build(deps-dev): bump the dev-dependencies group with 3 updates (#1224) 2025-04-14 13:18:33 +02:00
c2427fec79 docs: update problem matchers section 2025-04-07 17:34:24 +02:00
642f8ee631 build(deps): bump @types/node from 22.13.14 to 22.14.0 in the dependencies group (#1221) 2025-04-07 12:46:39 +02:00
d84be9250b build(deps-dev): bump the dev-dependencies group with 4 updates (#1220) 2025-04-07 12:46:14 +02:00
9551b25870 docs: typos and notes 2025-04-04 05:13:59 +02:00
f51fbec16f docs: add note about github.workspace (#1218)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2025-04-04 04:18:50 +02:00
a5307c8f68 build(deps-dev): bump the dev-dependencies group with 3 updates (#1215) 2025-03-31 15:10:29 +02:00
2968cc1a32 build(deps): bump the dependencies group across 1 directory with 3 updates (#1213)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2025-03-30 00:34:56 +01:00
1481404843 7.0.0 2025-03-24 15:20:12 +01:00
dec74fa030 feat: golangci-lint v2 support (#1198) 2025-03-24 15:16:39 +01:00
1f07148fa0 build(deps-dev): bump the dev-dependencies group with 3 updates (#1207)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2025-03-24 13:11:28 +01:00
9938e103f8 docs: fix checks permissions for annotations (#1204) 2025-03-19 12:23:45 +00:00
b91d580160 docs: update annotation permissions (#1203) 2025-03-19 00:29:57 +01:00
55c2c1448f 6.5.2 2025-03-17 22:50:27 +01:00
911ec56a22 fix: update max version (#1201) 2025-03-17 22:47:30 +01:00
eb5c0cc489 build(deps-dev): bump the dev-dependencies group with 2 updates (#1199) 2025-03-17 14:00:10 +01:00
4696ba8bab 6.5.1 2025-03-12 17:11:46 +01:00
2ee514f1f3 feat: restrict action v6 on golangci-lint v1 (#1194) 2025-03-12 17:10:24 +01:00
7e7b516e44 fix: octokit retry (#1193) 2025-03-12 17:09:01 +01:00
b871b4f9de build(deps): bump @types/node from 22.13.8 to 22.13.10 in the dependencies group (#1192) 2025-03-10 13:52:35 +01:00
08ba820282 build(deps-dev): bump eslint-config-prettier from 10.0.2 to 10.1.1 in the dev-dependencies group (#1191) 2025-03-10 13:52:11 +01:00
d8648ac2ed build(deps-dev): bump the dev-dependencies group across 1 directory with 5 updates (#1190) 2025-03-06 21:03:25 +01:00
37d62ae433 build(deps): bump the dependencies group with 2 updates (#1189)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2025-03-03 11:53:20 +00:00
7b561e5ab6 build(deps): bump @octokit/plugin-paginate-rest from 9.2.1 to 9.2.2 (#1187)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2025-02-24 13:11:36 +00:00
b63dc836c2 build(deps): bump @types/node from 22.13.4 to 22.13.5 in the dependencies group (#1186) 2025-02-24 13:44:21 +01:00
e8b0a12b47 build(deps-dev): bump the dev-dependencies group with 3 updates (#1185) 2025-02-24 13:43:55 +01:00
456fc0f735 docs: update examples 2025-02-22 19:01:11 +01:00
378320cf0d build(deps): bump @octokit/request from 8.4.0 to 8.4.1 (#1181)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2025-02-19 00:38:38 +01:00
0bc16cda6e build(deps): bump the dependencies group with 2 updates (#1178)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2025-02-17 13:01:26 +00:00
0f27d1f085 build(deps-dev): bump the dev-dependencies group with 3 updates (#1177) 2025-02-17 13:43:55 +01:00
3b4f037d0e docs: improve verify option explanation (#1175) 2025-02-17 05:54:54 +01:00
fe19838e9e docs: add notes for annotation config (#1173) 2025-02-16 18:21:00 +00:00
2226d7cb06 6.5.0 2025-02-15 15:16:43 +01:00
8d744d5b7f feat: verify with the JSONSchema by default (#1171) 2025-02-15 15:02:58 +01:00
0e58f8e7ab build(deps): bump @octokit/endpoint from 9.0.5 to 9.0.6 (#1170)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2025-02-15 04:31:44 +01:00
6a3fb764d5 build(deps): bump @octokit/request-error from 5.1.0 to 5.1.1 (#1169)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2025-02-15 03:19:17 +01:00
696fa5c0e7 chore: clean workflows 2025-02-15 02:47:53 +01:00
80284ede25 chore: use ubuntu-22.04-arm
ubuntu-24.04-arm is too unstable
2025-02-14 22:19:04 +01:00
818ec4d51a 6.4.1 2025-02-14 13:57:12 +01:00
1c50240be2 fix: use config arg for verify (#1168) 2025-02-14 13:56:21 +01:00
0adbc47a59 6.4.0 2025-02-13 23:15:38 +01:00
f7463c56f6 feat: add an option to verify with the JSONSchema (#1167) 2025-02-13 23:14:24 +01:00
32f961426b chore: extract patch related code (#1166) 2025-02-13 22:16:32 +01:00
19 changed files with 4656 additions and 6703 deletions

View File

@ -3,12 +3,10 @@ name: "Code Scanning - Action"
on: on:
push: push:
branches: branches:
- master
- main - main
pull_request: pull_request:
# The branches below must be a subset of the branches above # The branches below must be a subset of the branches above
branches: branches:
- master
- main - main
schedule: schedule:
- cron: '0 17 * * 5' - cron: '0 17 * * 5'

View File

@ -2,13 +2,10 @@ name: "build-and-test"
on: # rebuild any PRs and main branch changes on: # rebuild any PRs and main branch changes
pull_request: pull_request:
branches: branches:
- master
- main - main
push: push:
branches: branches:
- master
- main - main
- "releases/*"
jobs: jobs:
build: # make sure build/ci work properly build: # make sure build/ci work properly
@ -51,14 +48,14 @@ jobs:
matrix: matrix:
os: os:
- ubuntu-latest - ubuntu-latest
- ubuntu-24.04-arm - ubuntu-22.04-arm
- macos-latest - macos-latest
- windows-latest - windows-latest
version: version:
- "" - ""
- "latest" - "latest"
- "v1.63" # TODO(ldez): it should be updated for v2. - "v2.0"
- "v1.63.4" # TODO(ldez): it should be updated for v2. - "v2.0.0"
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
permissions: permissions:
contents: read contents: read
@ -80,14 +77,14 @@ jobs:
matrix: matrix:
os: os:
- ubuntu-latest - ubuntu-latest
- ubuntu-24.04-arm - ubuntu-22.04-arm
- macos-latest - macos-latest
- windows-latest - windows-latest
version: version:
- "" - ""
- "latest" - "latest"
- "v1.63.4" # TODO(ldez): it should be updated for v2. - "v2.0.0"
- "95c39ac1fbaf66475705c06c16259ffd9d6bf9a2" # TODO(ldez): it should be updated for v2. - "1f032fbc4b117e4247b19ff606cc847ab5383bc9"
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
permissions: permissions:
contents: read contents: read
@ -104,15 +101,18 @@ jobs:
only-new-issues: true only-new-issues: true
install-mode: goinstall install-mode: goinstall
test-go-mod-version: test-go-mod:
needs: [ build ] needs: [ build ]
strategy: strategy:
matrix: matrix:
os: os:
- ubuntu-latest - ubuntu-latest
- ubuntu-24.04-arm - ubuntu-22.04-arm
- macos-latest - macos-latest
- windows-latest - windows-latest
wd:
- sample-go-mod
- sample-go-tool
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
permissions: permissions:
contents: read contents: read
@ -123,27 +123,5 @@ jobs:
go-version: oldstable go-version: oldstable
- uses: ./ - uses: ./
with: with:
working-directory: sample-go-mod working-directory: ${{ matrix.wd }}
args: --timeout=5m --issues-exit-code=0 ./...
test-go-tool-version:
needs: [ build ]
strategy:
matrix:
os:
- ubuntu-latest
- ubuntu-24.04-arm
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- uses: ./
with:
working-directory: sample-go-tool
args: --timeout=5m --issues-exit-code=0 ./... args: --timeout=5m --issues-exit-code=0 ./...

7
.golangci.yml Normal file
View File

@ -0,0 +1,7 @@
version: "2"
output:
show-stats: true
sort-order:
- file
- linter

108
README.md
View File

@ -12,13 +12,13 @@ The action runs [golangci-lint](https://github.com/golangci/golangci-lint) and r
## Supporting Us ## Supporting Us
<!-- [![GitHub Sponsors](https://img.shields.io/badge/GitHub-Donate-blue?logo=github&style=for-the-badge)](https://github.com/sponsors/golangci) --> [![GitHub Sponsors](https://img.shields.io/badge/GitHub-Donate-blue?logo=github&style=for-the-badge)](https://github.com/sponsors/golangci)
[![Open Collective backers and sponsors](https://img.shields.io/badge/OpenCollective-Donate-blue?logo=opencollective&style=for-the-badge)](https://opencollective.com/golangci-lint) [![Open Collective backers and sponsors](https://img.shields.io/badge/OpenCollective-Donate-blue?logo=opencollective&style=for-the-badge)](https://opencollective.com/golangci-lint)
[![Linter Authors](https://img.shields.io/badge/Linter_Authors-Donate-blue?style=for-the-badge)](https://golangci-lint.run/product/thanks/) [![Linter Authors](https://img.shields.io/badge/Linter_Authors-Donate-blue?style=for-the-badge)](https://golangci-lint.run/product/thanks/)
`golangci-lint` is a free and open-source project built by volunteers. `golangci-lint` is a free and open-source project built by volunteers.
If you value it, consider supporting us, we appreciate it! :heart: If you value it, consider supporting us; we appreciate it! :heart:
## How to use ## How to use
@ -54,9 +54,9 @@ jobs:
with: with:
go-version: stable go-version: stable
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
version: v1.60 version: v2.0
``` ```
</details> </details>
@ -92,9 +92,9 @@ jobs:
with: with:
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
version: v1.60 version: v2.0
``` ```
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:
@ -120,7 +120,7 @@ on:
env: env:
GO_VERSION: stable GO_VERSION: stable
GOLANGCI_LINT_VERSION: v1.60 GOLANGCI_LINT_VERSION: v2.1
jobs: jobs:
detect-modules: detect-modules:
@ -147,10 +147,11 @@ jobs:
with: with:
go-version: ${{ env.GO_VERSION }} go-version: ${{ env.GO_VERSION }}
- name: golangci-lint ${{ matrix.modules }} - name: golangci-lint ${{ matrix.modules }}
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
version: ${{ env.GOLANGCI_LINT_VERSION }} version: ${{ env.GOLANGCI_LINT_VERSION }}
working-directory: ${{ matrix.modules }} working-directory: ${{ matrix.modules }}
args: --path-mode=abs
``` ```
</details> </details>
@ -179,7 +180,7 @@ jobs:
with: with:
os: ${{ matrix.os }} os: ${{ matrix.os }}
go-version: ${{ matrix.go-version }} go-version: ${{ matrix.go-version }}
golangci-lint-version: v1.60 golangci-lint-version: v2.1
``` ```
```yaml ```yaml
@ -201,7 +202,7 @@ on:
golangci-lint-version: golangci-lint-version:
description: 'Golangci-lint version' description: 'Golangci-lint version'
type: string type: string
default: 'v1.60' default: 'v2.1'
jobs: jobs:
detect-modules: detect-modules:
@ -229,10 +230,11 @@ jobs:
with: with:
go-version: ${{ inputs.go-version }} go-version: ${{ inputs.go-version }}
- name: golangci-lint ${{ matrix.modules }} - name: golangci-lint ${{ matrix.modules }}
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
version: ${{ inputs.golangci-lint-version }} version: ${{ inputs.golangci-lint-version }}
working-directory: ${{ matrix.modules }} working-directory: ${{ matrix.modules }}
args: --path-mode=abs
``` ```
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:
@ -245,12 +247,13 @@ You will also likely need to add the following `.gitattributes` file to ensure t
## Compatibility ## Compatibility
* `v7.0.0` supports golangci-lint v2 only.
* `v6.0.0+` removes `annotations` option, removes the default output format (`github-actions`). * `v6.0.0+` removes `annotations` option, removes the default output format (`github-actions`).
* `v5.0.0+` removes `skip-pkg-cache` and `skip-build-cache` because the cache related to Go itself is already handled by `actions/setup-go`. * `v5.0.0+` removes `skip-pkg-cache` and `skip-build-cache` because the cache related to Go itself is already handled by `actions/setup-go`.
* `v4.0.0+` requires an explicit `actions/setup-go` installation step before using this action: `uses: actions/setup-go@v5`. * `v4.0.0+` requires an explicit `actions/setup-go` installation step before using this action: `uses: actions/setup-go@v5`.
The `skip-go-installation` option has been removed. The `skip-go-installation` option has been removed.
* `v2.0.0+` works with `golangci-lint` version >= `v1.28.3` * `v2.0.0+` works with `golangci-lint` version >= `v1.28.3`
* `v1.2.2` is deprecated due to we forgot to change the minimum version of `golangci-lint` to `v1.28.3` ([issue](https://github.com/golangci/golangci-lint-action/issues/39)) * `v1.2.2` is deprecated because we forgot to change the minimum version of `golangci-lint` to `v1.28.3` ([issue](https://github.com/golangci/golangci-lint-action/issues/39))
* `v1.2.1` works with `golangci-lint` version >= `v1.14.0` ([issue](https://github.com/golangci/golangci-lint-action/issues/39)) * `v1.2.1` works with `golangci-lint` version >= `v1.14.0` ([issue](https://github.com/golangci/golangci-lint-action/issues/39))
## Options ## Options
@ -262,17 +265,17 @@ You will also likely need to add the following `.gitattributes` file to ensure t
The version of golangci-lint to use. The version of golangci-lint to use.
When `install-mode` is: When `install-mode` is:
* `binary` (default): the value can be v1.2 or v1.2.3 or `latest` to use the latest version. * `binary` (default): the value can be v2.3 or v2.3.4 or `latest` to use the latest version.
* `goinstall`: the value can be v1.2.3, `latest`, or the hash of a commit. * `goinstall`: the value can be v2.3.4, `latest`, or the hash of a commit.
* `none`: the value is ignored. * `none`: the value is ignored.
<details> <details>
<summary>Example</summary> <summary>Example</summary>
```yml ```yml
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
version: v1.58 version: v2.0
# ... # ...
``` ```
@ -290,7 +293,7 @@ The default value is `binary`.
<summary>Example</summary> <summary>Example</summary>
```yml ```yml
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
install-mode: "goinstall" install-mode: "goinstall"
# ... # ...
@ -310,7 +313,7 @@ By default, it uses the `github.token` from the action.
<summary>Example</summary> <summary>Example</summary>
```yml ```yml
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
github-token: xxx github-token: xxx
# ... # ...
@ -318,6 +321,29 @@ with:
</details> </details>
### `verify`
(optional)
This option is `true` by default.
If the GitHub Action detects a configuration file, the validation will be performed unless this option is set to `false`.
If there is no configuration file, the validation is skipped.
The JSON Schema used to validate the configuration depends on the version of golangci-lint you are using.
<details>
<summary>Example</summary>
```yml
uses: golangci/golangci-lint-action@v7
with:
verify: false
# ...
```
</details>
### `only-new-issues` ### `only-new-issues`
(optional) (optional)
@ -326,8 +352,8 @@ Show only new issues.
The default value is `false`. The default value is `false`.
* `pull_request` and `pull_request_target`: the action gets the diff of the PR content from the [GitHub API](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request) and use it with `--new-from-patch`. * `pull_request` and `pull_request_target`: the action gets the diff of the PR content from the [GitHub API](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request) and uses it with `--new-from-patch`.
* `push`: the action gets the diff of the push content (difference between commits before and after the push) from the [GitHub API](https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits) and use it with `--new-from-patch`. * `push`: the action gets the diff of the push content (difference between commits before and after the push) from the [GitHub API](https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits) and uses it with `--new-from-patch`.
* `merge_group`: the action gets the diff by using `--new-from-rev` option (relies on git). * `merge_group`: the action gets the diff by using `--new-from-rev` option (relies on git).
You should add the option `fetch-depth: 0` to `actions/checkout` step. You should add the option `fetch-depth: 0` to `actions/checkout` step.
@ -335,7 +361,7 @@ The default value is `false`.
<summary>Example</summary> <summary>Example</summary>
```yml ```yml
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
only-new-issues: true only-new-issues: true
# ... # ...
@ -353,7 +379,7 @@ Working directory, useful for monorepos.
<summary>Example</summary> <summary>Example</summary>
```yml ```yml
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
working-directory: somedir working-directory: somedir
# ... # ...
@ -367,16 +393,22 @@ with:
golangci-lint command line arguments. golangci-lint command line arguments.
Note: By default, the `.golangci.yml` file should be at the root of the repository. > [!NOTE]
The location of the configuration file can be changed by using `--config=` > By default, the `.golangci.yml` file should be at the root of the repository.
> The location of the configuration file can be changed by using `--config=`.
> [!IMPORTANT]
> Adding a `=` between the flag name and its value is important because the action parses the arguments on spaces.
<details> <details>
<summary>Example</summary> <summary>Example</summary>
```yml ```yml
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0 # In some rare cases,
# you could have to use `${{ github.workspace }}` as base directory to reference your configuration file.
args: --config=/my/path/.golangci.yml --issues-exit-code=0
# ... # ...
``` ```
@ -388,9 +420,9 @@ with:
Force the usage of the embedded problem matchers. Force the usage of the embedded problem matchers.
By default, the [problem matcher of Go (`actions/setup-go`)](https://github.com/actions/setup-go/blob/main/matchers.json) already handles the golangci-lint output (`colored-line-number`). By default, the [problem matcher of Go (`actions/setup-go`)](https://github.com/actions/setup-go/blob/main/matchers.json) already handles the default golangci-lint output (`text`).
Works only with `colored-line-number` (the golangci-lint default). Works only with `text` format (the golangci-lint default).
https://golangci-lint.run/usage/configuration/#output-configuration https://golangci-lint.run/usage/configuration/#output-configuration
@ -400,7 +432,7 @@ The default value is `false`.
<summary>Example</summary> <summary>Example</summary>
```yml ```yml
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
problem-matchers: true problem-matchers: true
# ... # ...
@ -421,7 +453,7 @@ The default value is `false`.
<summary>Example</summary> <summary>Example</summary>
```yml ```yml
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
skip-cache: true skip-cache: true
# ... # ...
@ -433,7 +465,7 @@ with:
(optional) (optional)
If set to `true`, caches will not be saved, but they may still be restored, required `skip-cache: false`. If set to `true`, caches will not be saved, but they may still be restored, requiring `skip-cache: false`.
The default value is `false`. The default value is `false`.
@ -441,7 +473,7 @@ The default value is `false`.
<summary>Example</summary> <summary>Example</summary>
```yml ```yml
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
skip-save-cache: true skip-save-cache: true
# ... # ...
@ -457,13 +489,13 @@ Periodically invalidate the cache every `cache-invalidation-interval` days to en
The default value is `7`. The default value is `7`.
If set the number is `<= 0`, the cache will be always invalidate (Not recommended). If the number is `<= 0`, the cache will always be invalidated (Not recommended).
<details> <details>
<summary>Example</summary> <summary>Example</summary>
```yml ```yml
uses: golangci/golangci-lint-action@v6 uses: golangci/golangci-lint-action@v7
with: with:
cache-invalidation-interval: 15 cache-invalidation-interval: 15
# ... # ...
@ -482,7 +514,7 @@ The restrictions of annotations are the following:
If you would like to have comments - please, up-vote [the issue](https://github.com/golangci/golangci-lint-action/issues/5). If you would like to have comments - please, up-vote [the issue](https://github.com/golangci/golangci-lint-action/issues/5).
3. The number of annotations is [limited](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md#limitations). 3. The number of annotations is [limited](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md#limitations).
To enable annotations, you need to add the `checks` permission to your action. Permissions required:
```yaml annotate ```yaml annotate
permissions: permissions:
@ -490,15 +522,15 @@ permissions:
contents: read contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option. # Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read pull-requests: read
# Optional: allow write access to checks to allow the action to annotate code in the PR.
checks: write
``` ```
For annotations to work, use the default format output (`text`) and either use `actions/setup-go` in the job or enable the internal [problem matchers](#problem-matchers).
## Performance ## Performance
The action was implemented with performance in mind: The action was implemented with performance in mind:
1. We cache data from golangci-lint analysis between builds by using [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache). 1. We cache data from golangci-lint analysis between builds by using [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache).
2. We don't use Docker because image pulling is slow. 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, and golangci-lint binary in parallel. 3. We do as much as we can in parallel, e.g. we download cache, and golangci-lint binary in parallel.

View File

@ -7,8 +7,8 @@ inputs:
description: | description: |
The version of golangci-lint to use. The version of golangci-lint to use.
When `install-mode` is: When `install-mode` is:
- `binary` (default): the value can be v1.2 or v1.2.3 or `latest` to use the latest version. - `binary` (default): the value can be v2.3 or v2.3.4 or `latest` to use the latest version.
- `goinstall`: the value can be v1.2.3, `latest`, or the hash of a commit. - `goinstall`: the value can be v2.3.4, `latest`, or the hash of a commit.
- `none`: the value is ignored. - `none`: the value is ignored.
required: false required: false
install-mode: install-mode:
@ -22,6 +22,10 @@ inputs:
description: "the token is used for fetching patch of a pull request to show only new issues" description: "the token is used for fetching patch of a pull request to show only new issues"
default: ${{ github.token }} default: ${{ github.token }}
required: false required: false
verify:
description: "if set to true and the action verify the configuration file against the JSONSchema"
default: 'true'
required: false
only-new-issues: only-new-issues:
description: "if set to true and the action runs on a pull request - the action outputs only newly found issues" description: "if set to true and the action runs on a pull request - the action outputs only newly found issues"
default: 'false' default: 'false'

5147
dist/post_run/index.js generated vendored

File diff suppressed because it is too large Load Diff

5147
dist/run/index.js generated vendored

File diff suppressed because it is too large Load Diff

2
go.mod
View File

@ -1,3 +1,3 @@
module github.com/golangci/golangci-lint-action module github.com/golangci/golangci-lint-action
go 1.14 go 1.23

408
package-lock.json generated
View File

@ -1,44 +1,46 @@
{ {
"name": "golanci-lint-action", "name": "golanci-lint-action",
"version": "6.3.3", "version": "7.0.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "golanci-lint-action", "name": "golanci-lint-action",
"version": "6.3.3", "version": "7.0.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "^4.0.0", "@actions/cache": "^4.0.3",
"@actions/core": "^1.11.1", "@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0", "@actions/github": "^6.0.0",
"@actions/http-client": "^2.2.3", "@actions/http-client": "^2.2.3",
"@actions/tool-cache": "^2.0.2", "@actions/tool-cache": "^2.0.2",
"@types/node": "^22.13.1", "@octokit/plugin-retry": "^6.1.0",
"@types/semver": "^7.5.8", "@types/node": "^22.14.1",
"@types/semver": "^7.7.0",
"@types/tmp": "^0.2.6", "@types/tmp": "^0.2.6",
"@types/which": "^3.0.4", "@types/which": "^3.0.4",
"tmp": "^0.2.3", "tmp": "^0.2.3",
"which": "^5.0.0" "which": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {
"@typescript-eslint/eslint-plugin": "^8.23.0", "@typescript-eslint/eslint-plugin": "^8.30.1",
"@typescript-eslint/parser": "^8.23.0", "@typescript-eslint/parser": "^8.30.1",
"@vercel/ncc": "^0.38.3", "@vercel/ncc": "^0.38.3",
"eslint": "^8.57.1", "eslint": "^8.57.1",
"eslint-config-prettier": "^10.0.1", "eslint-config-prettier": "^10.1.2",
"eslint-plugin-import": "^2.31.0", "eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.3", "eslint-plugin-prettier": "^5.2.6",
"eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-simple-import-sort": "^12.1.1",
"prettier": "^3.5.0", "prettier": "^3.5.3",
"typescript": "^5.7.3" "typescript": "^5.8.3"
} }
}, },
"node_modules/@actions/cache": { "node_modules/@actions/cache": {
"version": "4.0.0", "version": "4.0.3",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.0.tgz", "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.3.tgz",
"integrity": "sha512-WIuxjnZ44lNYtIS4fqSaYvF00hORdy3cSin+jx8xNgBVGWnNIAiCBHjlwusVQlcgExoQC9pHXGrDsZyZr7rCDQ==", "integrity": "sha512-SvrqFtYJ7I48A/uXNkoJrnukx5weQv1fGquhs3+4nkByZThBH109KTIqj5x/cGV7JGNvb8dLPVywUOqX1fjiXg==",
"license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.11.1", "@actions/core": "^1.11.1",
"@actions/exec": "^1.0.1", "@actions/exec": "^1.0.1",
@ -49,8 +51,7 @@
"@azure/ms-rest-js": "^2.6.0", "@azure/ms-rest-js": "^2.6.0",
"@azure/storage-blob": "^12.13.0", "@azure/storage-blob": "^12.13.0",
"@protobuf-ts/plugin": "^2.9.4", "@protobuf-ts/plugin": "^2.9.4",
"semver": "^6.3.1", "semver": "^6.3.1"
"twirp-ts": "^2.5.0"
} }
}, },
"node_modules/@actions/core": { "node_modules/@actions/core": {
@ -485,9 +486,10 @@
} }
}, },
"node_modules/@octokit/endpoint": { "node_modules/@octokit/endpoint": {
"version": "9.0.5", "version": "9.0.6",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.5.tgz", "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.6.tgz",
"integrity": "sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==", "integrity": "sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw==",
"license": "MIT",
"dependencies": { "dependencies": {
"@octokit/types": "^13.1.0", "@octokit/types": "^13.1.0",
"universal-user-agent": "^6.0.0" "universal-user-agent": "^6.0.0"
@ -515,9 +517,10 @@
"integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==" "integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg=="
}, },
"node_modules/@octokit/plugin-paginate-rest": { "node_modules/@octokit/plugin-paginate-rest": {
"version": "9.2.1", "version": "9.2.2",
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.1.tgz", "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.2.tgz",
"integrity": "sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==", "integrity": "sha512-u3KYkGF7GcZnSD/3UP0S7K5XUFT2FkOQdcfXZGZQPGv3lm4F2Xbf71lvjldr8c1H3nNbF+33cLEkWYbokGWqiQ==",
"license": "MIT",
"dependencies": { "dependencies": {
"@octokit/types": "^12.6.0" "@octokit/types": "^12.6.0"
}, },
@ -568,13 +571,31 @@
"@octokit/openapi-types": "^20.0.0" "@octokit/openapi-types": "^20.0.0"
} }
}, },
"node_modules/@octokit/request": { "node_modules/@octokit/plugin-retry": {
"version": "8.4.0", "version": "6.1.0",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-6.1.0.tgz",
"integrity": "sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==", "integrity": "sha512-WrO3bvq4E1Xh1r2mT9w6SDFg01gFmP81nIG77+p/MqW1JeXXgL++6umim3t6x0Zj5pZm3rXAN+0HEjmmdhIRig==",
"license": "MIT",
"dependencies": { "dependencies": {
"@octokit/endpoint": "^9.0.1", "@octokit/request-error": "^5.0.0",
"@octokit/request-error": "^5.1.0", "@octokit/types": "^13.0.0",
"bottleneck": "^2.15.3"
},
"engines": {
"node": ">= 18"
},
"peerDependencies": {
"@octokit/core": "5"
}
},
"node_modules/@octokit/request": {
"version": "8.4.1",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.1.tgz",
"integrity": "sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw==",
"license": "MIT",
"dependencies": {
"@octokit/endpoint": "^9.0.6",
"@octokit/request-error": "^5.1.1",
"@octokit/types": "^13.1.0", "@octokit/types": "^13.1.0",
"universal-user-agent": "^6.0.0" "universal-user-agent": "^6.0.0"
}, },
@ -583,9 +604,10 @@
} }
}, },
"node_modules/@octokit/request-error": { "node_modules/@octokit/request-error": {
"version": "5.1.0", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.0.tgz", "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.1.tgz",
"integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==", "integrity": "sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g==",
"license": "MIT",
"dependencies": { "dependencies": {
"@octokit/types": "^13.1.0", "@octokit/types": "^13.1.0",
"deprecation": "^2.0.0", "deprecation": "^2.0.0",
@ -612,10 +634,11 @@
} }
}, },
"node_modules/@pkgr/core": { "node_modules/@pkgr/core": {
"version": "0.1.1", "version": "0.2.1",
"resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.1.tgz",
"integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", "integrity": "sha512-VzgHzGblFmUeBmmrk55zPyrQIArQN4vujc9shWytaPdB3P7qhi0cpaiKIr7tlCmFv2lYUwnLospIqjL9ZSAhhg==",
"dev": true, "dev": true,
"license": "MIT",
"engines": { "engines": {
"node": "^12.20.0 || ^14.18.0 || >=16.0.0" "node": "^12.20.0 || ^14.18.0 || >=16.0.0"
}, },
@ -627,6 +650,7 @@
"version": "2.9.4", "version": "2.9.4",
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.4.tgz", "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.4.tgz",
"integrity": "sha512-Db5Laq5T3mc6ERZvhIhkj1rn57/p8gbWiCKxQWbZBBl20wMuqKoHbRw4tuD7FyXi+IkwTToaNVXymv5CY3E8Rw==", "integrity": "sha512-Db5Laq5T3mc6ERZvhIhkj1rn57/p8gbWiCKxQWbZBBl20wMuqKoHbRw4tuD7FyXi+IkwTToaNVXymv5CY3E8Rw==",
"license": "Apache-2.0",
"dependencies": { "dependencies": {
"@protobuf-ts/plugin-framework": "^2.9.4", "@protobuf-ts/plugin-framework": "^2.9.4",
"@protobuf-ts/protoc": "^2.9.4", "@protobuf-ts/protoc": "^2.9.4",
@ -643,6 +667,7 @@
"version": "2.9.4", "version": "2.9.4",
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.9.4.tgz", "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.9.4.tgz",
"integrity": "sha512-9nuX1kjdMliv+Pes8dQCKyVhjKgNNfwxVHg+tx3fLXSfZZRcUHMc1PMwB9/vTvc6gBKt9QGz5ERqSqZc0++E9A==", "integrity": "sha512-9nuX1kjdMliv+Pes8dQCKyVhjKgNNfwxVHg+tx3fLXSfZZRcUHMc1PMwB9/vTvc6gBKt9QGz5ERqSqZc0++E9A==",
"license": "(Apache-2.0 AND BSD-3-Clause)",
"dependencies": { "dependencies": {
"@protobuf-ts/runtime": "^2.9.4", "@protobuf-ts/runtime": "^2.9.4",
"typescript": "^3.9" "typescript": "^3.9"
@ -652,6 +677,7 @@
"version": "3.9.10", "version": "3.9.10",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
"integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
"license": "Apache-2.0",
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"
@ -664,6 +690,7 @@
"version": "3.9.10", "version": "3.9.10",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
"integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
"license": "Apache-2.0",
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"
@ -676,6 +703,7 @@
"version": "2.9.4", "version": "2.9.4",
"resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.9.4.tgz", "resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.9.4.tgz",
"integrity": "sha512-hQX+nOhFtrA+YdAXsXEDrLoGJqXHpgv4+BueYF0S9hy/Jq0VRTVlJS1Etmf4qlMt/WdigEes5LOd/LDzui4GIQ==", "integrity": "sha512-hQX+nOhFtrA+YdAXsXEDrLoGJqXHpgv4+BueYF0S9hy/Jq0VRTVlJS1Etmf4qlMt/WdigEes5LOd/LDzui4GIQ==",
"license": "Apache-2.0",
"bin": { "bin": {
"protoc": "protoc.js" "protoc": "protoc.js"
} }
@ -683,12 +711,14 @@
"node_modules/@protobuf-ts/runtime": { "node_modules/@protobuf-ts/runtime": {
"version": "2.9.4", "version": "2.9.4",
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.9.4.tgz", "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.9.4.tgz",
"integrity": "sha512-vHRFWtJJB/SiogWDF0ypoKfRIZ41Kq+G9cEFj6Qm1eQaAhJ1LDFvgZ7Ja4tb3iLOQhz0PaoPnnOijF1qmEqTxg==" "integrity": "sha512-vHRFWtJJB/SiogWDF0ypoKfRIZ41Kq+G9cEFj6Qm1eQaAhJ1LDFvgZ7Ja4tb3iLOQhz0PaoPnnOijF1qmEqTxg==",
"license": "(Apache-2.0 AND BSD-3-Clause)"
}, },
"node_modules/@protobuf-ts/runtime-rpc": { "node_modules/@protobuf-ts/runtime-rpc": {
"version": "2.9.4", "version": "2.9.4",
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.9.4.tgz", "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.9.4.tgz",
"integrity": "sha512-y9L9JgnZxXFqH5vD4d7j9duWvIJ7AShyBRoNKJGhu9Q27qIbchfzli66H9RvrQNIFk5ER7z1Twe059WZGqERcA==", "integrity": "sha512-y9L9JgnZxXFqH5vD4d7j9duWvIJ7AShyBRoNKJGhu9Q27qIbchfzli66H9RvrQNIFk5ER7z1Twe059WZGqERcA==",
"license": "Apache-2.0",
"dependencies": { "dependencies": {
"@protobuf-ts/runtime": "^2.9.4" "@protobuf-ts/runtime": "^2.9.4"
} }
@ -706,12 +736,12 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "22.13.1", "version": "22.14.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.1.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.1.tgz",
"integrity": "sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==", "integrity": "sha512-u0HuPQwe/dHrItgHHpmw3N2fYCR6x4ivMNbPHRkBVP4CvN+kiRrKHWk3i8tXiO/joPwXLMYvF9TTF0eqgHIuOw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"undici-types": "~6.20.0" "undici-types": "~6.21.0"
} }
}, },
"node_modules/@types/node-fetch": { "node_modules/@types/node-fetch": {
@ -737,9 +767,10 @@
} }
}, },
"node_modules/@types/semver": { "node_modules/@types/semver": {
"version": "7.5.8", "version": "7.7.0",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.0.tgz",
"integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==" "integrity": "sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==",
"license": "MIT"
}, },
"node_modules/@types/tmp": { "node_modules/@types/tmp": {
"version": "0.2.6", "version": "0.2.6",
@ -760,17 +791,17 @@
"integrity": "sha512-liyfuo/106JdlgSchJzXEQCVArk0CvevqPote8F8HgWgJ3dRCcTHgJIsLDuee0kxk/mhbInzIZk3QWSZJ8R+2w==" "integrity": "sha512-liyfuo/106JdlgSchJzXEQCVArk0CvevqPote8F8HgWgJ3dRCcTHgJIsLDuee0kxk/mhbInzIZk3QWSZJ8R+2w=="
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.23.0", "version": "8.30.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.23.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.30.1.tgz",
"integrity": "sha512-vBz65tJgRrA1Q5gWlRfvoH+w943dq9K1p1yDBY2pc+a1nbBLZp7fB9+Hk8DaALUbzjqlMfgaqlVPT1REJdkt/w==", "integrity": "sha512-v+VWphxMjn+1t48/jO4t950D6KR8JaJuNXzi33Ve6P8sEmPr5k6CEXjdGwT6+LodVnEa91EQCtwjWNUCPweo+Q==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eslint-community/regexpp": "^4.10.0", "@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "8.23.0", "@typescript-eslint/scope-manager": "8.30.1",
"@typescript-eslint/type-utils": "8.23.0", "@typescript-eslint/type-utils": "8.30.1",
"@typescript-eslint/utils": "8.23.0", "@typescript-eslint/utils": "8.30.1",
"@typescript-eslint/visitor-keys": "8.23.0", "@typescript-eslint/visitor-keys": "8.30.1",
"graphemer": "^1.4.0", "graphemer": "^1.4.0",
"ignore": "^5.3.1", "ignore": "^5.3.1",
"natural-compare": "^1.4.0", "natural-compare": "^1.4.0",
@ -786,20 +817,20 @@
"peerDependencies": { "peerDependencies": {
"@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0",
"eslint": "^8.57.0 || ^9.0.0", "eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <5.8.0" "typescript": ">=4.8.4 <5.9.0"
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "8.23.0", "version": "8.30.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.23.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.30.1.tgz",
"integrity": "sha512-h2lUByouOXFAlMec2mILeELUbME5SZRN/7R9Cw2RD2lRQQY08MWMM+PmVVKKJNK1aIwqTo9t/0CvOxwPbRIE2Q==", "integrity": "sha512-H+vqmWwT5xoNrXqWs/fesmssOW70gxFlgcMlYcBaWNPIEWDgLa4W9nkSPmhuOgLnXq9QYgkZ31fhDyLhleCsAg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "8.23.0", "@typescript-eslint/scope-manager": "8.30.1",
"@typescript-eslint/types": "8.23.0", "@typescript-eslint/types": "8.30.1",
"@typescript-eslint/typescript-estree": "8.23.0", "@typescript-eslint/typescript-estree": "8.30.1",
"@typescript-eslint/visitor-keys": "8.23.0", "@typescript-eslint/visitor-keys": "8.30.1",
"debug": "^4.3.4" "debug": "^4.3.4"
}, },
"engines": { "engines": {
@ -811,18 +842,18 @@
}, },
"peerDependencies": { "peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0", "eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <5.8.0" "typescript": ">=4.8.4 <5.9.0"
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "8.23.0", "version": "8.30.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.23.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.30.1.tgz",
"integrity": "sha512-OGqo7+dXHqI7Hfm+WqkZjKjsiRtFUQHPdGMXzk5mYXhJUedO7e/Y7i8AK3MyLMgZR93TX4bIzYrfyVjLC+0VSw==", "integrity": "sha512-+C0B6ChFXZkuaNDl73FJxRYT0G7ufVPOSQkqkpM/U198wUwUFOtgo1k/QzFh1KjpBitaK7R1tgjVz6o9HmsRPg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.23.0", "@typescript-eslint/types": "8.30.1",
"@typescript-eslint/visitor-keys": "8.23.0" "@typescript-eslint/visitor-keys": "8.30.1"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@ -833,14 +864,14 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "8.23.0", "version": "8.30.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.23.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.30.1.tgz",
"integrity": "sha512-iIuLdYpQWZKbiH+RkCGc6iu+VwscP5rCtQ1lyQ7TYuKLrcZoeJVpcLiG8DliXVkUxirW/PWlmS+d6yD51L9jvA==", "integrity": "sha512-64uBF76bfQiJyHgZISC7vcNz3adqQKIccVoKubyQcOnNcdJBvYOILV1v22Qhsw3tw3VQu5ll8ND6hycgAR5fEA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/typescript-estree": "8.23.0", "@typescript-eslint/typescript-estree": "8.30.1",
"@typescript-eslint/utils": "8.23.0", "@typescript-eslint/utils": "8.30.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"ts-api-utils": "^2.0.1" "ts-api-utils": "^2.0.1"
}, },
@ -853,13 +884,13 @@
}, },
"peerDependencies": { "peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0", "eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <5.8.0" "typescript": ">=4.8.4 <5.9.0"
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "8.23.0", "version": "8.30.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.23.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.30.1.tgz",
"integrity": "sha512-1sK4ILJbCmZOTt9k4vkoulT6/y5CHJ1qUYxqpF1K/DBAd8+ZUL4LlSCxOssuH5m4rUaaN0uS0HlVPvd45zjduQ==", "integrity": "sha512-81KawPfkuulyWo5QdyG/LOKbspyyiW+p4vpn4bYO7DM/hZImlVnFwrpCTnmNMOt8CvLRr5ojI9nU1Ekpw4RcEw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@ -871,14 +902,14 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "8.23.0", "version": "8.30.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.23.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.30.1.tgz",
"integrity": "sha512-LcqzfipsB8RTvH8FX24W4UUFk1bl+0yTOf9ZA08XngFwMg4Kj8A+9hwz8Cr/ZS4KwHrmo9PJiLZkOt49vPnuvQ==", "integrity": "sha512-kQQnxymiUy9tTb1F2uep9W6aBiYODgq5EMSk6Nxh4Z+BDUoYUSa029ISs5zTzKBFnexQEh71KqwjKnRz58lusQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.23.0", "@typescript-eslint/types": "8.30.1",
"@typescript-eslint/visitor-keys": "8.23.0", "@typescript-eslint/visitor-keys": "8.30.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"fast-glob": "^3.3.2", "fast-glob": "^3.3.2",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
@ -894,7 +925,7 @@
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"typescript": ">=4.8.4 <5.8.0" "typescript": ">=4.8.4 <5.9.0"
} }
}, },
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
@ -937,16 +968,16 @@
} }
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "8.23.0", "version": "8.30.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.23.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.30.1.tgz",
"integrity": "sha512-uB/+PSo6Exu02b5ZEiVtmY6RVYO7YU5xqgzTIVZwTHvvK3HsL8tZZHFaTLFtRG3CsV4A5mhOv+NZx5BlhXPyIA==", "integrity": "sha512-T/8q4R9En2tcEsWPQgB5BQ0XJVOtfARcUvOa8yJP3fh9M/mXraLxZrkCfGb6ChrO/V3W+Xbd04RacUEqk1CFEQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.4.0", "@eslint-community/eslint-utils": "^4.4.0",
"@typescript-eslint/scope-manager": "8.23.0", "@typescript-eslint/scope-manager": "8.30.1",
"@typescript-eslint/types": "8.23.0", "@typescript-eslint/types": "8.30.1",
"@typescript-eslint/typescript-estree": "8.23.0" "@typescript-eslint/typescript-estree": "8.30.1"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@ -957,17 +988,17 @@
}, },
"peerDependencies": { "peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0", "eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <5.8.0" "typescript": ">=4.8.4 <5.9.0"
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "8.23.0", "version": "8.30.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.23.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.30.1.tgz",
"integrity": "sha512-oWWhcWDLwDfu++BGTZcmXWqpwtkwb5o7fxUIGksMQQDSdPW9prsSnfIOZMlsj4vBOSrcnjIUZMiIjODgGosFhQ==", "integrity": "sha512-aEhgas7aJ6vZnNFC7K4/vMGDGyOiqWcYZPpIWrTKuTAlsvDNKy2GFDqh9smL+iq069ZvR0YzEeq0B8NJlLzjFA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.23.0", "@typescript-eslint/types": "8.30.1",
"eslint-visitor-keys": "^4.2.0" "eslint-visitor-keys": "^4.2.0"
}, },
"engines": { "engines": {
@ -1228,6 +1259,12 @@
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz",
"integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="
}, },
"node_modules/bottleneck": {
"version": "2.19.5",
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
"integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==",
"license": "MIT"
},
"node_modules/brace-expansion": { "node_modules/brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@ -1277,15 +1314,6 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/camel-case": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz",
"integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==",
"dependencies": {
"pascal-case": "^3.1.2",
"tslib": "^2.0.3"
}
},
"node_modules/chalk": { "node_modules/chalk": {
"version": "4.1.2", "version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
@ -1331,14 +1359,6 @@
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/commander": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz",
"integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==",
"engines": {
"node": ">= 6"
}
},
"node_modules/concat-map": { "node_modules/concat-map": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@ -1512,18 +1532,6 @@
"node": ">=6.0.0" "node": ">=6.0.0"
} }
}, },
"node_modules/dot-object": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/dot-object/-/dot-object-2.1.5.tgz",
"integrity": "sha512-xHF8EP4XH/Ba9fvAF2LDd5O3IITVolerVV6xvkxoM8zlGEiCUrggpAnHyOoKJKCrhvPcGATFAUwIujj7bRG5UA==",
"dependencies": {
"commander": "^6.1.0",
"glob": "^7.1.6"
},
"bin": {
"dot-object": "bin/dot-object"
}
},
"node_modules/es-abstract": { "node_modules/es-abstract": {
"version": "1.23.3", "version": "1.23.3",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz",
@ -1725,12 +1733,13 @@
} }
}, },
"node_modules/eslint-config-prettier": { "node_modules/eslint-config-prettier": {
"version": "10.0.1", "version": "10.1.2",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.0.1.tgz", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.2.tgz",
"integrity": "sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==", "integrity": "sha512-Epgp/EofAUeEpIdZkW60MHKvPyru1ruQJxPL+WIycnaPApuseK0Zpkrh/FwL9oIpQvIhJwV7ptOy0DWUjTlCiA==",
"dev": true, "dev": true,
"license": "MIT",
"bin": { "bin": {
"eslint-config-prettier": "build/bin/cli.js" "eslint-config-prettier": "bin/cli.js"
}, },
"peerDependencies": { "peerDependencies": {
"eslint": ">=7.0.0" "eslint": ">=7.0.0"
@ -1837,13 +1846,14 @@
} }
}, },
"node_modules/eslint-plugin-prettier": { "node_modules/eslint-plugin-prettier": {
"version": "5.2.3", "version": "5.2.6",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.3.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.6.tgz",
"integrity": "sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==", "integrity": "sha512-mUcf7QG2Tjk7H055Jk0lGBjbgDnfrvqjhXh9t2xLMSCjZVcw9Rb1V6sVNXO0th3jgeO7zllWPTNRil3JW94TnQ==",
"dev": true, "dev": true,
"license": "MIT",
"dependencies": { "dependencies": {
"prettier-linter-helpers": "^1.0.0", "prettier-linter-helpers": "^1.0.0",
"synckit": "^0.9.1" "synckit": "^0.11.0"
}, },
"engines": { "engines": {
"node": "^14.18.0 || >=16.0.0" "node": "^14.18.0 || >=16.0.0"
@ -1854,7 +1864,7 @@
"peerDependencies": { "peerDependencies": {
"@types/eslint": ">=8.0.0", "@types/eslint": ">=8.0.0",
"eslint": ">=8.0.0", "eslint": ">=8.0.0",
"eslint-config-prettier": "*", "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0",
"prettier": ">=3.0.0" "prettier": ">=3.0.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
@ -2124,7 +2134,8 @@
"node_modules/fs.realpath": { "node_modules/fs.realpath": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
"dev": true
}, },
"node_modules/function-bind": { "node_modules/function-bind": {
"version": "1.1.2", "version": "1.1.2",
@ -2202,6 +2213,7 @@
"version": "7.2.3", "version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"dev": true,
"dependencies": { "dependencies": {
"fs.realpath": "^1.0.0", "fs.realpath": "^1.0.0",
"inflight": "^1.0.4", "inflight": "^1.0.4",
@ -2398,6 +2410,7 @@
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
"dev": true,
"dependencies": { "dependencies": {
"once": "^1.3.0", "once": "^1.3.0",
"wrappy": "1" "wrappy": "1"
@ -2406,7 +2419,8 @@
"node_modules/inherits": { "node_modules/inherits": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
}, },
"node_modules/internal-slot": { "node_modules/internal-slot": {
"version": "1.0.7", "version": "1.0.7",
@ -2770,25 +2784,12 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"node_modules/lodash.merge": { "node_modules/lodash.merge": {
"version": "4.6.2", "version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
"dev": true "dev": true
}, },
"node_modules/lower-case": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz",
"integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==",
"dependencies": {
"tslib": "^2.0.3"
}
},
"node_modules/merge2": { "node_modules/merge2": {
"version": "1.4.1", "version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
@ -2862,15 +2863,6 @@
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
"dev": true "dev": true
}, },
"node_modules/no-case": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",
"integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==",
"dependencies": {
"lower-case": "^2.0.2",
"tslib": "^2.0.3"
}
},
"node_modules/node-fetch": { "node_modules/node-fetch": {
"version": "2.7.0", "version": "2.7.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
@ -3042,15 +3034,6 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/pascal-case": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz",
"integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==",
"dependencies": {
"no-case": "^3.0.4",
"tslib": "^2.0.3"
}
},
"node_modules/path-exists": { "node_modules/path-exists": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
@ -3064,6 +3047,7 @@
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"dev": true,
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }
@ -3083,11 +3067,6 @@
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true "dev": true
}, },
"node_modules/path-to-regexp": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
"integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ=="
},
"node_modules/picomatch": { "node_modules/picomatch": {
"version": "2.3.1", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
@ -3119,9 +3098,9 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "3.5.0", "version": "3.5.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.0.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz",
"integrity": "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==", "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"bin": { "bin": {
@ -3501,19 +3480,20 @@
} }
}, },
"node_modules/synckit": { "node_modules/synckit": {
"version": "0.9.1", "version": "0.11.2",
"resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.1.tgz", "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.2.tgz",
"integrity": "sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==", "integrity": "sha512-1IUffI8zZ8qUMB3NUJIjk0RpLroG/8NkQDAWH1NbB2iJ0/5pn3M8rxfNzMz4GH9OnYaGYn31LEDSXJp/qIlxgA==",
"dev": true, "dev": true,
"license": "MIT",
"dependencies": { "dependencies": {
"@pkgr/core": "^0.1.0", "@pkgr/core": "^0.2.0",
"tslib": "^2.6.2" "tslib": "^2.8.1"
}, },
"engines": { "engines": {
"node": "^14.18.0 || >=16.0.0" "node": "^14.18.0 || >=16.0.0"
}, },
"funding": { "funding": {
"url": "https://opencollective.com/unts" "url": "https://opencollective.com/synckit"
} }
}, },
"node_modules/text-table": { "node_modules/text-table": {
@ -3560,29 +3540,6 @@
"typescript": ">=4.8.4" "typescript": ">=4.8.4"
} }
}, },
"node_modules/ts-poet": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-4.15.0.tgz",
"integrity": "sha512-sLLR8yQBvHzi9d4R1F4pd+AzQxBfzOSSjfxiJxQhkUoH5bL7RsAC6wgvtVUQdGqiCsyS9rT6/8X2FI7ipdir5g==",
"dependencies": {
"lodash": "^4.17.15",
"prettier": "^2.5.1"
}
},
"node_modules/ts-poet/node_modules/prettier": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/tsconfig-paths": { "node_modules/tsconfig-paths": {
"version": "3.15.0", "version": "3.15.0",
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz",
@ -3596,9 +3553,10 @@
} }
}, },
"node_modules/tslib": { "node_modules/tslib": {
"version": "2.6.2", "version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"license": "0BSD"
}, },
"node_modules/tunnel": { "node_modules/tunnel": {
"version": "0.0.6", "version": "0.0.6",
@ -3608,34 +3566,6 @@
"node": ">=0.6.11 <=0.7.0 || >=0.7.3" "node": ">=0.6.11 <=0.7.0 || >=0.7.3"
} }
}, },
"node_modules/twirp-ts": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/twirp-ts/-/twirp-ts-2.5.0.tgz",
"integrity": "sha512-JTKIK5Pf/+3qCrmYDFlqcPPUx+ohEWKBaZy8GL8TmvV2VvC0SXVyNYILO39+GCRbqnuP6hBIF+BVr8ZxRz+6fw==",
"dependencies": {
"@protobuf-ts/plugin-framework": "^2.0.7",
"camel-case": "^4.1.2",
"dot-object": "^2.1.4",
"path-to-regexp": "^6.2.0",
"ts-poet": "^4.5.0",
"yaml": "^1.10.2"
},
"bin": {
"protoc-gen-twirp_ts": "protoc-gen-twirp_ts"
},
"peerDependencies": {
"@protobuf-ts/plugin": "^2.5.0",
"ts-proto": "^1.81.3"
},
"peerDependenciesMeta": {
"@protobuf-ts/plugin": {
"optional": true
},
"ts-proto": {
"optional": true
}
}
},
"node_modules/type-check": { "node_modules/type-check": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
@ -3734,10 +3664,11 @@
} }
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "5.7.3", "version": "5.8.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
"integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
"dev": true, "dev": true,
"license": "Apache-2.0",
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"
@ -3774,9 +3705,10 @@
} }
}, },
"node_modules/undici-types": { "node_modules/undici-types": {
"version": "6.20.0", "version": "6.21.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
"integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==" "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
"license": "MIT"
}, },
"node_modules/universal-user-agent": { "node_modules/universal-user-agent": {
"version": "6.0.1", "version": "6.0.1",
@ -3889,14 +3821,6 @@
"node": ">=4.0" "node": ">=4.0"
} }
}, },
"node_modules/yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"engines": {
"node": ">= 6"
}
},
"node_modules/yocto-queue": { "node_modules/yocto-queue": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",

View File

@ -1,6 +1,6 @@
{ {
"name": "golanci-lint-action", "name": "golanci-lint-action",
"version": "6.3.3", "version": "7.0.1",
"private": true, "private": true,
"description": "golangci-lint github action", "description": "golangci-lint github action",
"main": "dist/main.js", "main": "dist/main.js",
@ -24,29 +24,30 @@
"author": "golangci", "author": "golangci",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "^4.0.0", "@actions/cache": "^4.0.3",
"@actions/core": "^1.11.1", "@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0", "@actions/github": "^6.0.0",
"@actions/http-client": "^2.2.3", "@actions/http-client": "^2.2.3",
"@octokit/plugin-retry": "^6.1.0",
"@actions/tool-cache": "^2.0.2", "@actions/tool-cache": "^2.0.2",
"@types/node": "^22.13.1", "@types/node": "^22.14.1",
"@types/semver": "^7.5.8", "@types/semver": "^7.7.0",
"@types/tmp": "^0.2.6", "@types/tmp": "^0.2.6",
"@types/which": "^3.0.4", "@types/which": "^3.0.4",
"tmp": "^0.2.3", "tmp": "^0.2.3",
"which": "^5.0.0" "which": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {
"@typescript-eslint/eslint-plugin": "^8.23.0", "@typescript-eslint/eslint-plugin": "^8.30.1",
"@typescript-eslint/parser": "^8.23.0", "@typescript-eslint/parser": "^8.30.1",
"@vercel/ncc": "^0.38.3", "@vercel/ncc": "^0.38.3",
"eslint": "^8.57.1", "eslint": "^8.57.1",
"eslint-config-prettier": "^10.0.1", "eslint-config-prettier": "^10.1.2",
"eslint-plugin-import": "^2.31.0", "eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.3", "eslint-plugin-prettier": "^5.2.6",
"eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-simple-import-sort": "^12.1.1",
"prettier": "^3.5.0", "prettier": "^3.5.3",
"typescript": "^5.7.3" "typescript": "^5.8.3"
} }
} }

View File

@ -0,0 +1,7 @@
version: "2"
output:
show-stats: true
sort-order:
- file
- linter

View File

@ -2,7 +2,7 @@ module sample
go 1.22.1 go 1.22.1
require github.com/golangci/golangci-lint v1.60.1 require github.com/golangci/golangci-lint/v2 v2.0.0
require ( require (
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect

View File

@ -3,5 +3,5 @@
package main package main
import ( import (
_ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "github.com/golangci/golangci-lint/v2/cmd/golangci-lint"
) )

View File

@ -0,0 +1,7 @@
version: "2"
output:
show-stats: true
sort-order:
- file
- linter

View File

@ -4,7 +4,7 @@ go 1.24
toolchain go1.24.0 toolchain go1.24.0
tool github.com/golangci/golangci-lint/cmd/golangci-lint tool github.com/golangci/golangci-lint/v2/cmd/golangci-lint
require ( require (
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect
@ -68,7 +68,7 @@ require (
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect
github.com/golangci/go-printf-func-name v0.1.0 // indirect github.com/golangci/go-printf-func-name v0.1.0 // indirect
github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d // indirect github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d // indirect
github.com/golangci/golangci-lint v1.64.4 // indirect github.com/golangci/golangci-lint/v2 v2.0.0 // indirect
github.com/golangci/misspell v0.6.0 // indirect github.com/golangci/misspell v0.6.0 // indirect
github.com/golangci/plugin-module-register v0.1.1 // indirect github.com/golangci/plugin-module-register v0.1.1 // indirect
github.com/golangci/revgrep v0.8.0 // indirect github.com/golangci/revgrep v0.8.0 // indirect

View File

@ -4,41 +4,12 @@ import { exec, ExecOptions } from "child_process"
import os from "os" import os from "os"
import path from "path" import path from "path"
import { promisify } from "util" import { promisify } from "util"
import which from "which"
import { VersionInfo } from "./version" import { getVersion, VersionInfo } from "./version"
const execShellCommand = promisify(exec) const execShellCommand = promisify(exec)
const getAssetURL = (versionInfo: VersionInfo): string => {
let ext = "tar.gz"
let platform = os.platform().toString()
switch (platform) {
case "win32":
platform = "windows"
ext = "zip"
break
}
let arch = os.arch()
switch (arch) {
case "arm64":
arch = "arm64"
break
case "x64":
arch = "amd64"
break
case "x32":
case "ia32":
arch = "386"
break
}
const noPrefix = versionInfo.TargetVersion.slice(1)
return `https://github.com/golangci/golangci-lint/releases/download/${versionInfo.TargetVersion}/golangci-lint-${noPrefix}-${platform}-${arch}.${ext}`
}
export enum InstallMode { export enum InstallMode {
Binary = "binary", Binary = "binary",
GoInstall = "goinstall", GoInstall = "goinstall",
@ -59,6 +30,27 @@ const printOutput = (res: ExecRes): void => {
} }
} }
/**
* Install golangci-lint.
*
* @returns path to installed binary of golangci-lint.
*/
export async function install(): Promise<string> {
const mode = core.getInput("install-mode").toLowerCase()
if (mode === InstallMode.None) {
const binPath = await which("golangci-lint", { nothrow: true })
if (!binPath) {
throw new Error("golangci-lint binary not found in the PATH")
}
return binPath
}
const versionInfo = await getVersion(<InstallMode>mode)
return await installBinary(versionInfo, <InstallMode>mode)
}
/** /**
* Install golangci-lint. * Install golangci-lint.
* *
@ -66,7 +58,7 @@ const printOutput = (res: ExecRes): void => {
* @param mode installation mode. * @param mode installation mode.
* @returns path to installed binary of golangci-lint. * @returns path to installed binary of golangci-lint.
*/ */
export async function installLint(versionInfo: VersionInfo, mode: InstallMode): Promise<string> { export async function installBinary(versionInfo: VersionInfo, mode: InstallMode): Promise<string> {
core.info(`Installation mode: ${mode}`) core.info(`Installation mode: ${mode}`)
switch (mode) { switch (mode) {
@ -85,23 +77,21 @@ export async function installLint(versionInfo: VersionInfo, mode: InstallMode):
* @param versionInfo information about version to install. * @param versionInfo information about version to install.
* @returns path to installed binary of golangci-lint. * @returns path to installed binary of golangci-lint.
*/ */
export async function goInstall(versionInfo: VersionInfo): Promise<string> { async function goInstall(versionInfo: VersionInfo): Promise<string> {
core.info(`Installing golangci-lint ${versionInfo.TargetVersion}...`) core.info(`Installing golangci-lint ${versionInfo.TargetVersion}...`)
const startedAt = Date.now() const startedAt = Date.now()
const options: ExecOptions = { env: { ...process.env, CGO_ENABLED: "1" } } const options: ExecOptions = { env: { ...process.env, CGO_ENABLED: "1" } }
// TODO(ldez): it should be updated for v2.
const exres = await execShellCommand( const exres = await execShellCommand(
`go install github.com/golangci/golangci-lint/cmd/golangci-lint@${versionInfo.TargetVersion}`, `go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${versionInfo.TargetVersion}`,
options options
) )
printOutput(exres) printOutput(exres)
// TODO(ldez): it should be updated for v2.
const res = await execShellCommand( const res = await execShellCommand(
`go install -n github.com/golangci/golangci-lint/cmd/golangci-lint@${versionInfo.TargetVersion}`, `go install -n github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${versionInfo.TargetVersion}`,
options options
) )
printOutput(res) printOutput(res)
@ -125,7 +115,7 @@ export async function goInstall(versionInfo: VersionInfo): Promise<string> {
* @param versionInfo information about version to install. * @param versionInfo information about version to install.
* @returns path to installed binary of golangci-lint. * @returns path to installed binary of golangci-lint.
*/ */
export async function installBin(versionInfo: VersionInfo): Promise<string> { async function installBin(versionInfo: VersionInfo): Promise<string> {
core.info(`Installing golangci-lint binary ${versionInfo.TargetVersion}...`) core.info(`Installing golangci-lint binary ${versionInfo.TargetVersion}...`)
const startedAt = Date.now() const startedAt = Date.now()
@ -158,3 +148,33 @@ export async function installBin(versionInfo: VersionInfo): Promise<string> {
return binPath return binPath
} }
function getAssetURL(versionInfo: VersionInfo): string {
let ext = "tar.gz"
let platform = os.platform().toString()
switch (platform) {
case "win32":
platform = "windows"
ext = "zip"
break
}
let arch = os.arch()
switch (arch) {
case "arm64":
arch = "arm64"
break
case "x64":
arch = "amd64"
break
case "x32":
case "ia32":
arch = "386"
break
}
const noPrefix = versionInfo.TargetVersion.slice(1)
return `https://github.com/golangci/golangci-lint/releases/download/${versionInfo.TargetVersion}/golangci-lint-${noPrefix}-${platform}-${arch}.${ext}`
}

120
src/patch.ts Normal file
View File

@ -0,0 +1,120 @@
import * as core from "@actions/core"
import * as github from "@actions/github"
import { Context } from "@actions/github/lib/context"
import * as pluginRetry from "@octokit/plugin-retry"
import fs from "fs"
import path from "path"
import { dir } from "tmp"
import { promisify } from "util"
import { alterDiffPatch } from "./utils/diffUtils"
const writeFile = promisify(fs.writeFile)
const createTempDir = promisify(dir)
export function isOnlyNewIssues(): boolean {
return core.getBooleanInput(`only-new-issues`, { required: true })
}
export async function fetchPatch(): Promise<string> {
if (!isOnlyNewIssues()) {
return ``
}
const ctx = github.context
switch (ctx.eventName) {
case `pull_request`:
case `pull_request_target`:
return await fetchPullRequestPatch(ctx)
case `push`:
return await fetchPushPatch(ctx)
case `merge_group`:
return ``
default:
core.info(`Not fetching patch for showing only new issues because it's not a pull request context: event name is ${ctx.eventName}`)
return ``
}
}
async function fetchPullRequestPatch(ctx: Context): Promise<string> {
const pr = ctx.payload.pull_request
if (!pr) {
core.warning(`No pull request in context`)
return ``
}
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }), {}, pluginRetry.retry)
let patch: string
try {
const patchResp = await octokit.rest.pulls.get({
owner: ctx.repo.owner,
repo: ctx.repo.repo,
[`pull_number`]: pr.number,
mediaType: {
format: `diff`,
},
})
if (patchResp.status !== 200) {
core.warning(`failed to fetch pull request patch: response status is ${patchResp.status}`)
return `` // don't fail the action, but analyze without patch
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
patch = patchResp.data as any
} catch (err) {
console.warn(`failed to fetch pull request patch:`, err)
return `` // don't fail the action, but analyze without patch
}
try {
const tempDir = await createTempDir()
const patchPath = path.join(tempDir, "pull.patch")
core.info(`Writing patch to ${patchPath}`)
await writeFile(patchPath, alterDiffPatch(patch))
return patchPath
} catch (err) {
console.warn(`failed to save pull request patch:`, err)
return `` // don't fail the action, but analyze without patch
}
}
async function fetchPushPatch(ctx: Context): Promise<string> {
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }), {}, pluginRetry.retry)
let patch: string
try {
const patchResp = await octokit.rest.repos.compareCommitsWithBasehead({
owner: ctx.repo.owner,
repo: ctx.repo.repo,
basehead: `${ctx.payload.before}...${ctx.payload.after}`,
mediaType: {
format: `diff`,
},
})
if (patchResp.status !== 200) {
core.warning(`failed to fetch push patch: response status is ${patchResp.status}`)
return `` // don't fail the action, but analyze without patch
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
patch = patchResp.data as any
} catch (err) {
console.warn(`failed to fetch push patch:`, err)
return `` // don't fail the action, but analyze without patch
}
try {
const tempDir = await createTempDir()
const patchPath = path.join(tempDir, "push.patch")
core.info(`Writing patch to ${patchPath}`)
await writeFile(patchPath, alterDiffPatch(patch))
return patchPath
} catch (err) {
console.warn(`failed to save pull request patch:`, err)
return `` // don't fail the action, but analyze without patch
}
}

View File

@ -1,144 +1,15 @@
import * as core from "@actions/core" import * as core from "@actions/core"
import * as github from "@actions/github" import * as github from "@actions/github"
import { Context } from "@actions/github/lib/context"
import { exec, ExecOptions } from "child_process" import { exec, ExecOptions } from "child_process"
import * as fs from "fs" import * as fs from "fs"
import * as path from "path" import * as path from "path"
import { dir } from "tmp"
import { promisify } from "util" import { promisify } from "util"
import which from "which"
import { restoreCache, saveCache } from "./cache" import { restoreCache, saveCache } from "./cache"
import { installLint, InstallMode } from "./install" import { install } from "./install"
import { alterDiffPatch } from "./utils/diffUtils" import { fetchPatch, isOnlyNewIssues } from "./patch"
import { getVersion } from "./version"
const execShellCommand = promisify(exec) const execShellCommand = promisify(exec)
const writeFile = promisify(fs.writeFile)
const createTempDir = promisify(dir)
function isOnlyNewIssues(): boolean {
return core.getBooleanInput(`only-new-issues`, { required: true })
}
async function prepareLint(): Promise<string> {
const mode = core.getInput("install-mode").toLowerCase()
if (mode === InstallMode.None) {
const binPath = await which("golangci-lint", { nothrow: true })
if (!binPath) {
throw new Error("golangci-lint binary not found in the PATH")
}
return binPath
}
const versionInfo = await getVersion(<InstallMode>mode)
return await installLint(versionInfo, <InstallMode>mode)
}
async function fetchPatch(): Promise<string> {
if (!isOnlyNewIssues()) {
return ``
}
const ctx = github.context
switch (ctx.eventName) {
case `pull_request`:
case `pull_request_target`:
return await fetchPullRequestPatch(ctx)
case `push`:
return await fetchPushPatch(ctx)
case `merge_group`:
return ``
default:
core.info(`Not fetching patch for showing only new issues because it's not a pull request context: event name is ${ctx.eventName}`)
return ``
}
}
async function fetchPullRequestPatch(ctx: Context): Promise<string> {
const pr = ctx.payload.pull_request
if (!pr) {
core.warning(`No pull request in context`)
return ``
}
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }))
let patch: string
try {
const patchResp = await octokit.rest.pulls.get({
owner: ctx.repo.owner,
repo: ctx.repo.repo,
[`pull_number`]: pr.number,
mediaType: {
format: `diff`,
},
})
if (patchResp.status !== 200) {
core.warning(`failed to fetch pull request patch: response status is ${patchResp.status}`)
return `` // don't fail the action, but analyze without patch
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
patch = patchResp.data as any
} catch (err) {
console.warn(`failed to fetch pull request patch:`, err)
return `` // don't fail the action, but analyze without patch
}
try {
const tempDir = await createTempDir()
const patchPath = path.join(tempDir, "pull.patch")
core.info(`Writing patch to ${patchPath}`)
await writeFile(patchPath, alterDiffPatch(patch))
return patchPath
} catch (err) {
console.warn(`failed to save pull request patch:`, err)
return `` // don't fail the action, but analyze without patch
}
}
async function fetchPushPatch(ctx: Context): Promise<string> {
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }))
let patch: string
try {
const patchResp = await octokit.rest.repos.compareCommitsWithBasehead({
owner: ctx.repo.owner,
repo: ctx.repo.repo,
basehead: `${ctx.payload.before}...${ctx.payload.after}`,
mediaType: {
format: `diff`,
},
})
if (patchResp.status !== 200) {
core.warning(`failed to fetch push patch: response status is ${patchResp.status}`)
return `` // don't fail the action, but analyze without patch
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
patch = patchResp.data as any
} catch (err) {
console.warn(`failed to fetch push patch:`, err)
return `` // don't fail the action, but analyze without patch
}
try {
const tempDir = await createTempDir()
const patchPath = path.join(tempDir, "push.patch")
core.info(`Writing patch to ${patchPath}`)
await writeFile(patchPath, alterDiffPatch(patch))
return patchPath
} catch (err) {
console.warn(`failed to save pull request patch:`, err)
return `` // don't fail the action, but analyze without patch
}
}
type Env = { type Env = {
binPath: string binPath: string
@ -151,7 +22,7 @@ async function prepareEnv(): Promise<Env> {
// Prepare cache, lint and go in parallel. // Prepare cache, lint and go in parallel.
await restoreCache() await restoreCache()
const binPath = await prepareLint() const binPath = await install()
const patchPath = await fetchPatch() const patchPath = await fetchPatch()
core.info(`Prepared env in ${Date.now() - startedAt}ms`) core.info(`Prepared env in ${Date.now() - startedAt}ms`)
@ -180,7 +51,7 @@ async function runLint(binPath: string, patchPath: string): Promise<void> {
printOutput(res) printOutput(res)
} }
let userArgs = core.getInput(`args`) const userArgs = core.getInput(`args`)
const addedArgs: string[] = [] const addedArgs: string[] = []
const userArgsList = userArgs const userArgsList = userArgs
@ -205,23 +76,13 @@ async function runLint(binPath: string, patchPath: string): Promise<void> {
} }
} }
const formats = (userArgsMap.get("out-format") || "")
.trim()
.split(",")
.filter((f) => f.length > 0)
.filter((f) => !f.startsWith(`github-actions`)) // Removes `github-actions` format.
.join(",")
if (formats) {
// Adds formats but without `github-actions` format.
addedArgs.push(`--out-format=${formats}`)
}
// Removes `--out-format` from the user flags because it's already inside `addedArgs`.
userArgs = userArgs.replace(/--out-format=\S*/gi, "").trim()
if (isOnlyNewIssues()) { if (isOnlyNewIssues()) {
if (userArgNames.has(`new`) || userArgNames.has(`new-from-rev`) || userArgNames.has(`new-from-patch`)) { if (
userArgNames.has(`new`) ||
userArgNames.has(`new-from-rev`) ||
userArgNames.has(`new-from-patch`) ||
userArgNames.has(`new-from-merge-base`)
) {
throw new Error(`please, don't specify manually --new* args when requesting only new issues`) throw new Error(`please, don't specify manually --new* args when requesting only new issues`)
} }
@ -239,6 +100,7 @@ async function runLint(binPath: string, patchPath: string): Promise<void> {
// Override config values. // Override config values.
addedArgs.push(`--new=false`) addedArgs.push(`--new=false`)
addedArgs.push(`--new-from-rev=`) addedArgs.push(`--new-from-rev=`)
addedArgs.push(`--new-from-merge-base=`)
} }
break break
case `merge_group`: case `merge_group`:
@ -247,6 +109,7 @@ async function runLint(binPath: string, patchPath: string): Promise<void> {
// Override config values. // Override config values.
addedArgs.push(`--new=false`) addedArgs.push(`--new=false`)
addedArgs.push(`--new-from-patch=`) addedArgs.push(`--new-from-patch=`)
addedArgs.push(`--new-from-merge-base=`)
break break
default: default:
break break
@ -266,6 +129,8 @@ async function runLint(binPath: string, patchPath: string): Promise<void> {
cmdArgs.cwd = path.resolve(workingDirectory) cmdArgs.cwd = path.resolve(workingDirectory)
} }
await runVerify(binPath, userArgsMap, cmdArgs)
const cmd = `${binPath} run ${addedArgs.join(` `)} ${userArgs}`.trimEnd() const cmd = `${binPath} run ${addedArgs.join(` `)} ${userArgs}`.trimEnd()
core.info(`Running [${cmd}] in [${cmdArgs.cwd || process.cwd()}] ...`) core.info(`Running [${cmd}] in [${cmdArgs.cwd || process.cwd()}] ...`)
@ -277,7 +142,6 @@ async function runLint(binPath: string, patchPath: string): Promise<void> {
core.info(`golangci-lint found no issues`) core.info(`golangci-lint found no issues`)
} catch (exc) { } catch (exc) {
// This logging passes issues to GitHub annotations but comments can be more convenient for some users. // This logging passes issues to GitHub annotations but comments can be more convenient for some users.
// TODO: support reviewdog or leaving comments by GitHub API.
printOutput(exc) printOutput(exc)
if (exc.code === 1) { if (exc.code === 1) {
@ -290,6 +154,44 @@ async function runLint(binPath: string, patchPath: string): Promise<void> {
core.info(`Ran golangci-lint in ${Date.now() - startedAt}ms`) core.info(`Ran golangci-lint in ${Date.now() - startedAt}ms`)
} }
async function runVerify(binPath: string, userArgsMap: Map<string, string>, cmdArgs: ExecOptions): Promise<void> {
const verify = core.getBooleanInput(`verify`, { required: true })
if (!verify) {
return
}
const cfgPath = await getConfigPath(binPath, userArgsMap, cmdArgs)
if (!cfgPath) {
return
}
let cmdVerify = `${binPath} config verify`
if (userArgsMap.get("config")) {
cmdVerify += ` --config=${userArgsMap.get("config")}`
}
core.info(`Running [${cmdVerify}] in [${cmdArgs.cwd || process.cwd()}] ...`)
const res = await execShellCommand(cmdVerify, cmdArgs)
printOutput(res)
}
async function getConfigPath(binPath: string, userArgsMap: Map<string, string>, cmdArgs: ExecOptions): Promise<string> {
let cmdConfigPath = `${binPath} config path`
if (userArgsMap.get("config")) {
cmdConfigPath += ` --config=${userArgsMap.get("config")}`
}
core.info(`Running [${cmdConfigPath}] in [${cmdArgs.cwd || process.cwd()}] ...`)
try {
const resPath = await execShellCommand(cmdConfigPath, cmdArgs)
return resPath.stderr.trim()
} catch {
return ``
}
}
export async function run(): Promise<void> { export async function run(): Promise<void> {
try { try {
const { binPath, patchPath } = await core.group(`prepare environment`, prepareEnv) const { binPath, patchPath } = await core.group(`prepare environment`, prepareEnv)

View File

@ -13,12 +13,10 @@ export type Version = {
} | null } | null
const versionRe = /^v(\d+)\.(\d+)(?:\.(\d+))?$/ const versionRe = /^v(\d+)\.(\d+)(?:\.(\d+))?$/
// TODO(ldez): it should be updated to match v2 module name. const modVersionRe = /github.com\/golangci\/golangci-lint\/v2\s(v\S+)/
const modVersionRe = /github.com\/golangci\/golangci-lint\s(v\S+)/
const parseVersion = (s: string): Version => { const parseVersion = (s: string): Version => {
if (s == "latest" || s == "") { if (s == "latest" || s == "") {
// TODO(ldez): it should be replaced with an explicit version (ex: v1.64.0)
return null return null
} }
@ -27,6 +25,10 @@ const parseVersion = (s: string): Version => {
throw new Error(`invalid version string '${s}', expected format v1.2 or v1.2.3`) throw new Error(`invalid version string '${s}', expected format v1.2 or v1.2.3`)
} }
if (parseInt(match[1]) !== 2) {
throw new Error(`invalid version string '${s}', golangci-lint v${match[1]} is not supported by golangci-lint-action v7.`)
}
return { return {
major: parseInt(match[1]), major: parseInt(match[1]),
minor: parseInt(match[2]), minor: parseInt(match[2]),
@ -41,11 +43,10 @@ export const stringifyVersion = (v: Version): string => {
return `v${v.major}.${v.minor}${v.patch !== null ? `.${v.patch}` : ``}` return `v${v.major}.${v.minor}${v.patch !== null ? `.${v.patch}` : ``}`
} }
// TODO(ldez): it should be updated to v2.0.0.
const minVersion = { const minVersion = {
major: 1, major: 2,
minor: 28, minor: 0,
patch: 3, patch: 0,
} }
const isLessVersion = (a: Version, b: Version): boolean => { const isLessVersion = (a: Version, b: Version): boolean => {
@ -115,8 +116,7 @@ const fetchVersionMapping = async (): Promise<VersionMapping> => {
maxRetries: 5, maxRetries: 5,
}) })
try { try {
// TODO(ldez): HEAD should be replaced with an explicit version (ex: v1.64.0). const url = `https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/assets/github-action-config-v2.json`
const url = `https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/assets/github-action-config-v1.json`
const response: httpm.HttpClientResponse = await http.get(url) const response: httpm.HttpClientResponse = await http.get(url)
if (response.message.statusCode !== 200) { if (response.message.statusCode !== 200) {
throw new Error(`failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`) throw new Error(`failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`)
@ -134,15 +134,14 @@ export async function getVersion(mode: InstallMode): Promise<VersionInfo> {
if (mode == InstallMode.GoInstall) { if (mode == InstallMode.GoInstall) {
const v: string = core.getInput(`version`) const v: string = core.getInput(`version`)
// TODO(ldez): latest should be replaced with an explicit version (ex: v1.64.0).
return { TargetVersion: v ? v : "latest" } return { TargetVersion: v ? v : "latest" }
} }
const reqVersion = getRequestedVersion() const reqVersion = getRequestedVersion()
// if the patched version is passed, just use it // if the patched version is passed, just use it
// TODO(ldez): should be updated to `reqVersion?.major === 2`. if (reqVersion?.major === 2 && reqVersion?.minor != null && reqVersion?.patch !== null) {
if (reqVersion?.major === 1 && reqVersion?.minor != null && reqVersion?.patch !== null) {
return new Promise((resolve) => { return new Promise((resolve) => {
const versionWithoutV = `${reqVersion.major}.${reqVersion.minor}.${reqVersion.patch}` const versionWithoutV = `${reqVersion.major}.${reqVersion.minor}.${reqVersion.patch}`
resolve({ TargetVersion: `v${versionWithoutV}` }) resolve({ TargetVersion: `v${versionWithoutV}` })