Compare commits

..

47 Commits

Author SHA1 Message Date
82d40c283a feat: remove Go cache management (#1024) 2024-04-25 03:26:57 +02:00
c683728f10 feat: add option to not save cache (#851) 2024-04-25 01:17:21 +00:00
bf6479d5ec feat: add support for pull_request_target and only-new-issues (#506) 2024-04-25 03:03:53 +02:00
d6238b002a build(deps-dev): bump @typescript-eslint/eslint-plugin from 7.6.0 to 7.7.0 (#1023) 2024-04-22 16:53:44 +02:00
847b9efe2e build(deps-dev): bump @typescript-eslint/parser from 7.5.0 to 7.7.0 (#1022) 2024-04-22 11:09:08 +02:00
019c5ec617 build(deps-dev): bump eslint-plugin-simple-import-sort from 12.0.0 to 12.1.0 (#1018) 2024-04-15 11:30:10 +00:00
3dea681709 build(deps-dev): bump @typescript-eslint/eslint-plugin from 7.5.0 to 7.6.0 (#1019) 2024-04-15 13:23:06 +02:00
155e5ebdeb build(deps-dev): bump typescript from 5.4.4 to 5.4.5 (#1017) 2024-04-15 13:22:12 +02:00
14117827cf build(deps): bump @types/node from 20.12.5 to 20.12.7 (#1016) 2024-04-15 13:21:54 +02:00
e3c1789d3f build(deps-dev): bump @typescript-eslint/parser from 7.4.0 to 7.5.0 (#1014) 2024-04-08 15:02:41 +02:00
24de455de2 build(deps-dev): bump @typescript-eslint/eslint-plugin from 7.4.0 to 7.5.0 (#1013) 2024-04-08 13:31:32 +02:00
0068957dcf build(deps): bump @types/node from 20.12.2 to 20.12.5 (#1012) 2024-04-08 13:31:06 +02:00
8cca243457 build(deps-dev): bump typescript from 5.4.3 to 5.4.4 (#1011) 2024-04-08 13:30:51 +02:00
c1ec8d27ed build(deps): bump undici from 5.28.3 to 5.28.4 (#1010)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2024-04-04 21:23:29 +02:00
80ffcf7ac5 build(deps-dev): bump @typescript-eslint/parser from 7.3.1 to 7.4.0 (#1009) 2024-04-01 16:07:04 +02:00
c9cf8614bf build(deps-dev): bump @typescript-eslint/eslint-plugin from 7.3.1 to 7.4.0 (#1008) 2024-04-01 14:50:56 +02:00
ca92b655d7 build(deps): bump @types/node from 20.11.30 to 20.12.2 (#1007) 2024-04-01 14:50:30 +02:00
e637d2bbe4 build(deps-dev): bump @typescript-eslint/parser from 7.2.0 to 7.3.1 (#1006) 2024-03-25 11:54:13 +00:00
f7e6ffb14d build(deps-dev): bump typescript from 5.4.2 to 5.4.3 (#1005) 2024-03-25 12:42:58 +01:00
04092870fd build(deps): bump @types/node from 20.11.28 to 20.11.30 (#1004) 2024-03-25 12:42:27 +01:00
15ace4fc54 build(deps-dev): bump @typescript-eslint/eslint-plugin from 7.2.0 to 7.3.1 (#1003) 2024-03-25 12:42:10 +01:00
66db41e5dd build(deps-dev): bump @typescript-eslint/eslint-plugin from 7.1.1 to 7.2.0 (#999) 2024-03-18 13:41:34 +01:00
a54aa6ce0b build(deps): bump @types/node from 20.11.25 to 20.11.28 (#1000) 2024-03-18 13:22:57 +01:00
0cb4e4ce8a build(deps-dev): bump @typescript-eslint/parser from 7.1.1 to 7.2.0 (#998) 2024-03-18 13:22:29 +01:00
c2b1114313 build(deps): bump google.golang.org/protobuf from 1.28.0 to 1.33.0 in /sample-go-mod (#997) 2024-03-13 23:01:31 +01:00
1ef822c9e7 build(deps): bump @actions/http-client from 2.2.0 to 2.2.1 (#995)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2024-03-11 19:03:02 +01:00
0cf702c571 build(deps-dev): bump @typescript-eslint/eslint-plugin from 7.1.0 to 7.1.1 (#994) 2024-03-11 17:35:13 +01:00
e0e0b2b842 build(deps-dev): bump typescript from 5.3.3 to 5.4.2 (#993) 2024-03-11 17:23:20 +01:00
d7b3f577a7 build(deps): bump @types/node from 20.11.24 to 20.11.25 (#992) 2024-03-11 17:23:00 +01:00
a3062e4021 build(deps-dev): bump @typescript-eslint/parser from 7.1.0 to 7.1.1 (#991) 2024-03-11 17:22:40 +01:00
0cea014686 build(deps): bump @types/node from 20.11.20 to 20.11.24 (#990) 2024-03-04 13:43:42 +01:00
c9cca96908 build(deps-dev): bump @typescript-eslint/parser from 6.21.0 to 7.1.0 (#988)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2024-03-04 13:40:26 +01:00
2e99f461f3 build(deps): bump tmp from 0.2.1 to 0.2.3 (#989)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2024-03-04 13:36:42 +01:00
27463c1456 build(deps-dev): bump eslint from 8.56.0 to 8.57.0 (#987) 2024-02-26 17:04:02 +01:00
47f5f04922 build(deps): bump @types/semver from 7.5.7 to 7.5.8 (#986) 2024-02-26 13:09:12 +00:00
6d0160cbf8 build(deps): bump @types/node from 20.11.19 to 20.11.20 (#985) 2024-02-26 14:00:14 +01:00
52b846a8b5 build(deps): bump undici from 5.26.3 to 5.28.3 (#976)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2024-02-19 15:35:38 +01:00
3f7fc68782 build(deps-dev): bump @typescript-eslint/eslint-plugin from 6.21.0 to 7.0.0 (#980) 2024-02-19 14:40:55 +01:00
1eba11c6d8 build(deps): bump @types/node from 20.11.17 to 20.11.19 (#979) 2024-02-19 14:40:33 +01:00
552a57d5dc docs: update the version of the action used in the README example (#977)
Co-authored-by: Ludovic Fernandez <ldez@users.noreply.github.com>
2024-02-17 15:43:17 +00:00
a83e3d11f6 build(deps): bump @types/node from 20.11.16 to 20.11.17 (#972) 2024-02-12 16:33:45 +01:00
2fc4c770fc build(deps-dev): bump @typescript-eslint/eslint-plugin from 6.20.0 to 6.21.0 (#973) 2024-02-12 16:33:36 +01:00
0ea26a0a52 build(deps-dev): bump eslint-plugin-simple-import-sort from 10.0.0 to 12.0.0 (#971) 2024-02-12 15:12:04 +01:00
f1a742892f build(deps-dev): bump @typescript-eslint/parser from 6.20.0 to 6.21.0 (#970) 2024-02-12 15:11:56 +01:00
2031bb15ab build(deps): bump @types/semver from 7.5.6 to 7.5.7 (#969) 2024-02-12 15:11:44 +01:00
17bf0db4b7 chore: use olstable as Go version 2024-02-12 14:12:44 +01:00
de85e3b9b1 chore: update tested golangci-lint version 2024-02-12 13:57:04 +01:00
11 changed files with 2555 additions and 5941 deletions

View File

@ -52,8 +52,8 @@ jobs:
version:
- ""
- "latest"
- "v1.53"
- "v1.53.2"
- "v1.56"
- "v1.56.1"
runs-on: ${{ matrix.os }}
permissions:
contents: read
@ -62,6 +62,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: oldstable
cache: false # setup-go v4 caches by default
- uses: ./
with:
@ -80,8 +81,8 @@ jobs:
version:
- ""
- "latest"
- "v1.53.2"
- "b5093688c0d3008eaacd6066773a1a52e689252f"
- "v1.56.1"
- "bf5008a11acf2da5fe76716eb21d808499e079fa"
runs-on: ${{ matrix.os }}
permissions:
contents: read
@ -90,6 +91,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: oldstable
cache: false # setup-go v4 caches by default
- uses: ./
with:
@ -113,6 +115,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: oldstable
cache: false # setup-go v4 caches by default
- uses: ./
with:

View File

@ -9,7 +9,7 @@ The action runs [golangci-lint](https://github.com/golangci/golangci-lint) and r
## Compatibility
* `v3.0.0+` requires explicit setup-go installation step prior to using this action: `uses: actions/setup-go@v3`.
* `v4.0.0+` requires an explicit setup-go installation step before using this action: `uses: actions/setup-go@v5`.
The `skip-go-installation` option has been removed.
* `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))
@ -38,18 +38,18 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
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.54
version: v1.57
# Optional: working directory, useful for monorepos
# working-directory: somedir
@ -67,11 +67,9 @@ jobs:
# takes precedence over all other caching options.
# skip-cache: true
# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
# skip-pkg-cache: true
# Optional: if set to true, then the action won't cache or restore ~/.cache/go-build.
# skip-build-cache: true
# Optional: if set to true, caches will not be saved, but they may still be restored,
# subject to other options
# skip-save-cache: true
# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
# install-mode: "goinstall"
@ -107,13 +105,13 @@ jobs:
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
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.

View File

@ -29,12 +29,10 @@ inputs:
takes precedence over all other caching options.
default: 'false'
required: false
skip-pkg-cache:
description: "if set to true then the action doesn't cache or restore ~/go/pkg."
default: 'false'
required: false
skip-build-cache:
description: "if set to true then the action doesn't cache or restore ~/.cache/go-build."
skip-save-cache:
description: |
if set to true then the action will not save any caches, but it may still
restore existing caches, subject to other options.
default: 'false'
required: false
install-mode:

3938
dist/post_run/index.js generated vendored

File diff suppressed because it is too large Load Diff

3938
dist/run/index.js generated vendored

File diff suppressed because it is too large Load Diff

524
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -28,23 +28,23 @@
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"@actions/http-client": "^2.2.0",
"@actions/http-client": "^2.2.1",
"@actions/tool-cache": "^2.0.1",
"@types/node": "^20.11.16",
"@types/semver": "^7.5.6",
"@types/node": "^20.12.7",
"@types/semver": "^7.5.8",
"@types/tmp": "^0.2.6",
"tmp": "^0.2.1"
"tmp": "^0.2.3"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-simple-import-sort": "^12.1.0",
"prettier": "^3.2.5",
"typescript": "^5.3.3"
"typescript": "^5.4.5"
}
}

View File

@ -167,7 +167,7 @@ require (
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.6.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect

View File

@ -924,8 +924,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View File

@ -23,26 +23,6 @@ const getLintCacheDir = (): string => {
return path.resolve(`${process.env.HOME}/.cache/golangci-lint`)
}
const getCacheDirs = (): string[] => {
// Not existing dirs are ok here: it works.
const skipPkgCache = core.getInput(`skip-pkg-cache`, { required: true }).trim()
const skipBuildCache = core.getInput(`skip-build-cache`, { required: true }).trim()
const dirs = [getLintCacheDir()]
if (skipBuildCache.toLowerCase() == "true") {
core.info(`Omitting ~/.cache/go-build from cache directories`)
} else {
dirs.push(path.resolve(`${process.env.HOME}/.cache/go-build`))
}
if (skipPkgCache.toLowerCase() == "true") {
core.info(`Omitting ~/go/pkg from cache directories`)
} else {
dirs.push(path.resolve(`${process.env.HOME}/go/pkg`))
}
return dirs
}
const getIntervalKey = (invalidationIntervalDays: number): string => {
const now = new Date()
const secondsSinceEpoch = now.getTime() / 1000
@ -97,7 +77,7 @@ export async function restoreCache(): Promise<void> {
}
core.saveState(State.CachePrimaryKey, primaryKey)
try {
const cacheKey = await cache.restoreCache(getCacheDirs(), primaryKey, restoreKeys)
const cacheKey = await cache.restoreCache([getLintCacheDir()], primaryKey, restoreKeys)
if (!cacheKey) {
core.info(`Cache not found for input keys: ${[primaryKey, ...restoreKeys].join(", ")}`)
return
@ -116,6 +96,7 @@ export async function restoreCache(): Promise<void> {
export async function saveCache(): Promise<void> {
if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return
if (core.getInput(`skip-save-cache`, { required: true }).trim() == "true") return
// Validate inputs, this can cause task failure
if (!utils.isValidEvent()) {
@ -127,7 +108,7 @@ export async function saveCache(): Promise<void> {
const startedAt = Date.now()
const cacheDirs = getCacheDirs()
const cacheDirs = [getLintCacheDir()]
const primaryKey = core.getState(State.CachePrimaryKey)
if (!primaryKey) {
utils.logWarning(`Error retrieving key from state.`)

View File

@ -32,7 +32,7 @@ async function fetchPatch(): Promise<string> {
}
const ctx = github.context
if (ctx.eventName !== `pull_request`) {
if (ctx.eventName !== `pull_request` && ctx.eventName !== `pull_request_target`) {
core.info(`Not fetching patch for showing only new issues because it's not a pull request context: event name is ${ctx.eventName}`)
return ``
}