Compare commits

..

42 Commits

Author SHA1 Message Date
a12ae43dd8 Add --overwrite flag to tar extraction (#156)
* Add --overwrite flag to tar extraction

There are times when previous actions have already extracted at least
some files to the cache location. This results in subsequent cache
extraction operations to emit errors such as:

> /usr/bin/tar: [dest_file_path]: Cannot open: File exists

This adds the --overwrite flag to the extract call to force tar to
just overwrite these files rather than reporting errors.

Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>

* npm run lint-fix & npm run format

* ignore macOS

Co-authored-by: Sergey Vilgelm <sergey.vilgelm@ibm.com>
2021-02-23 09:00:58 -06:00
f1dee55574 build(deps-dev): bump eslint-config-prettier from 6.15.0 to 8.0.0 (#168)
* build(deps-dev): bump eslint-config-prettier from 6.15.0 to 8.0.0

Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 6.15.0 to 8.0.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v6.15.0...v8.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

* update .eslintrc.json and re-build

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sergey Vilgelm <sergey.vilgelm@ibm.com>
2021-02-23 07:29:01 -06:00
Zik
23487cb16f Update "version" config in README example (#167)
#98 was closed by #101, but the README still says that only a major-minor version is accepted. It also says that this field is required, but `action.yml` says otherwise. Copy the description from `action.yml` into the README for consistency.
2021-02-23 06:20:09 -06:00
84560243ae build(deps-dev): bump @typescript-eslint/eslint-plugin (#171)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.34.0 to 4.15.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.15.1/packages/eslint-plugin)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-22 09:22:09 -06:00
3e54e516ae build(deps-dev): bump @types/node from 14.14.28 to 14.14.31 (#170) 2021-02-22 13:40:06 +01:00
2f717c44f2 build(deps-dev): bump @typescript-eslint/parser from 4.15.0 to 4.15.1 (#169) 2021-02-22 13:07:56 +01:00
4a6ab128b0 build(deps-dev): bump @types/node from 14.14.25 to 14.14.28 (#164)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.25 to 14.14.28.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-16 22:39:02 +11:00
f9b6927981 build(deps-dev): bump eslint from 6.8.0 to 7.20.0 (#163)
Bumps [eslint](https://github.com/eslint/eslint) from 6.8.0 to 7.20.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v6.8.0...v7.20.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-16 22:38:50 +11:00
41858b8c7c build(deps-dev): bump typescript from 4.1.3 to 4.1.5 (#162) 2021-02-16 12:16:09 +01:00
67236c010b build(deps-dev): bump @typescript-eslint/parser from 2.34.0 to 4.15.0 (#161) 2021-02-16 12:15:38 +01:00
544d2efb30 Update dist folder (#160) 2021-02-14 18:50:33 +01:00
0dd30832fc Add options to skip caching of folders. (#154)
Add option to skip caching the Go package directory (~/go/pkg).
Add option to skip caching the Go build directory (~/.cache/go-build).
Update README to mention new options.
2021-02-14 10:59:58 -06:00
e1ae6cf354 build(deps-dev): bump @types/node from 14.14.22 to 14.14.25 (#158) 2021-02-08 10:04:43 +01:00
0ef0ffc44e build(deps): bump @actions/cache from 1.0.5 to 1.0.6 (#159)
Bumps [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache) from 1.0.5 to 1.0.6.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-08 16:54:09 +11:00
125ac487c1 build(deps-dev): bump @types/node from 14.14.21 to 14.14.22 (#152)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.21 to 14.14.22.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-25 14:18:44 +08:00
e246bba31d Fix a typo in README.md (it's->its) (#151)
See https://www.grammarly.com/blog/possessive-pronouns/: A Common Mistake: Its vs. It’s
2021-01-23 01:23:41 +01:00
147f37a473 build(deps-dev): bump @types/node from 14.14.20 to 14.14.21 (#149)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.20 to 14.14.21.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 14:12:26 +08:00
a19645e82f build(deps-dev): bump eslint-plugin-prettier from 3.3.0 to 3.3.1 (#148) 2021-01-11 10:15:27 +01:00
286cf073ea build(deps-dev): bump @types/node from 14.14.19 to 14.14.20 (#147) 2021-01-11 10:15:08 +01:00
7641a6707d build(deps-dev): bump @types/node from 14.14.16 to 14.14.19 (#145)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.16 to 14.14.19.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-04 14:22:37 +08:00
e4e910b0ce Add a skip-go-installation to use pre-installed Go (#144)
* update package-lock.json

* Add skip-go-installation to use pre-installed Go

Add the golangci-lint to PATH
2020-12-31 11:20:57 -06:00
89d96d6c20 build(deps-dev): bump eslint-plugin-simple-import-sort from 5.0.3 to 7.0.0 (#137)
* build(deps-dev): bump eslint-plugin-simple-import-sort

Bumps [eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort) from 5.0.3 to 7.0.0.
- [Release notes](https://github.com/lydell/eslint-plugin-simple-import-sort/releases)
- [Changelog](https://github.com/lydell/eslint-plugin-simple-import-sort/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lydell/eslint-plugin-simple-import-sort/compare/v5.0.3...v7.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

* update dist

* update .eslintrc.json

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sergey Vilgelm <sergey.vilgelm@ibm.com>
2020-12-28 22:41:47 -06:00
45f3a377de build(deps-dev): bump @types/node from 14.14.14 to 14.14.16 (#143)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.14 to 14.14.16.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-28 14:10:50 +08:00
943013ec20 build(deps-dev): bump @types/node from 14.14.13 to 14.14.14 (#142) 2020-12-21 10:16:58 +01:00
49a9e469b1 build(deps-dev): bump typescript from 4.1.2 to 4.1.3 (#140)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-14 14:20:44 +08:00
528677aa24 build(deps-dev): bump @types/node from 14.14.10 to 14.14.13 (#139)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.10 to 14.14.13.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-14 14:20:04 +08:00
85798b53e5 build(deps): bump @actions/cache from 1.0.4 to 1.0.5 (#141)
Bumps [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-14 14:19:45 +08:00
d164f0d6d8 build(deps-dev): bump eslint-plugin-prettier from 3.2.0 to 3.3.0 (#138)
Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v3.2.0...v3.3.0)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-14 14:19:29 +08:00
9cf34bb2b8 build(deps-dev): bump eslint-plugin-prettier from 3.1.4 to 3.2.0 (#136)
Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 3.1.4 to 3.2.0.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v3.1.4...v3.2.0)

Signed-off-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: Xiang Dai <long0dai@foxmail.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-07 14:12:21 +08:00
629aad184c build(deps-dev): bump @types/node from 14.14.9 to 14.14.10 (#134)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.9 to 14.14.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-30 14:15:03 +08:00
1bac7d9888 build(deps-dev): bump prettier from 2.1.2 to 2.2.1 (#133)
Bumps [prettier](https://github.com/prettier/prettier) from 2.1.2 to 2.2.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.1.2...2.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: Xiang Dai <long0dai@foxmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-30 14:14:12 +08:00
44fae30515 build(deps-dev): bump typescript from 4.0.5 to 4.1.2 (#131)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.0.5 to 4.1.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.0.5...v4.1.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-23 18:32:03 +11:00
689e90e8a0 build(deps-dev): bump @types/node from 14.14.7 to 14.14.9 (#130)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.7 to 14.14.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-23 18:31:53 +11:00
d73150ab3c build(deps-dev): bump @types/node from 14.14.6 to 14.14.7 (#124)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.6 to 14.14.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-16 17:02:36 +11:00
2c3839ff26 build(deps): bump @actions/tool-cache from 1.6.0 to 1.6.1 (#125)
Bumps [@actions/tool-cache](https://github.com/actions/toolkit/tree/HEAD/packages/tool-cache) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/tool-cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/tool-cache)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-16 17:02:13 +11:00
f881d993a0 build(deps): bump @actions/cache from 1.0.3 to 1.0.4 (#123)
Bumps [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache) from 1.0.3 to 1.0.4.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-09 16:55:23 +11:00
d3f3b8adb7 build(deps-dev): bump typescript from 4.0.3 to 4.0.5 (#120)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.0.3 to 4.0.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.0.3...v4.0.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-02 17:28:54 +11:00
e3e2a92cbd build(deps-dev): bump @types/node from 14.14.3 to 14.14.6 (#121)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.3 to 14.14.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-02 17:28:31 +11:00
e1bd4355fb build(deps-dev): bump eslint-config-prettier from 6.14.0 to 6.15.0 (#122)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 6.14.0 to 6.15.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v6.14.0...v6.15.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-02 17:28:13 +11:00
345e5340e3 build(deps-dev): bump @types/node from 14.11.10 to 14.14.3 (#116)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.11.10 to 14.14.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-26 17:21:51 +11:00
13e9e901f4 build(deps): bump @actions/cache from 1.0.2 to 1.0.3 (#117)
Bumps [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-26 16:54:07 +11:00
771153bfbc build(deps-dev): bump eslint-config-prettier from 6.13.0 to 6.14.0 (#115)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 6.13.0 to 6.14.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v6.13.0...v6.14.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-26 16:53:40 +11:00
10 changed files with 33341 additions and 18326 deletions

View File

@ -1,7 +1,13 @@
{
"env": { "node": true, "jest": true },
"env": {
"node": true,
"jest": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": { "ecmaVersion": 2020, "sourceType": "module" },
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
@ -9,15 +15,18 @@
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended",
"prettier/@typescript-eslint"
"plugin:prettier/recommended"
],
"plugins": [
"@typescript-eslint",
"simple-import-sort"
],
"plugins": ["@typescript-eslint", "simple-import-sort"],
"rules": {
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"simple-import-sort/sort": "error",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"sort-imports": "off"
}
}
}

View File

@ -2,7 +2,7 @@
[![Build Status](https://github.com/golangci/golangci-lint-action/workflows/build-and-test/badge.svg)](https://github.com/golangci/golangci-lint-action/actions)
It's the official GitHub action for [golangci-lint](https://github.com/golangci/golangci-lint) from it's authors.
It's the official GitHub action for [golangci-lint](https://github.com/golangci/golangci-lint) from its authors.
The action runs [golangci-lint](https://github.com/golangci/golangci-lint) and reports issues from linters.
![GitHub Annotations](./static/annotations.png)
@ -36,7 +36,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.29
# Optional: working directory, useful for monorepos
@ -47,6 +47,15 @@ jobs:
# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
# Optional: if set to true then the action will use pre-installed Go.
# skip-go-installation: true
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
```
We recommend running this action in a job separate from other jobs (`go test`, etc)
@ -94,7 +103,7 @@ jobs:
You will also likely need to add the following `.gitattributes` file to ensure that line endings for windows builds are properly formatted:
```.gitattributes
*.go text eol=lf
*.go text eol=lf
```
## Comments and Annotations

View File

@ -1,4 +1,3 @@
---
name: "Run golangci-lint"
description: "Official golangci-lint action with line-attached annotations for found issues, caching and parallel execution."
author: "golangci"
@ -21,7 +20,18 @@ inputs:
description: "if set to true and the action runs on a pull request - the action outputs only newly found issues"
default: false
required: true
skip-go-installation:
description: "if set to true then action uses pre-installed Go"
default: false
required: true
skip-pkg-cache:
description: "if set to true then the action don't cache or restore ~/go/pkg."
default: false
required: true
skip-build-cache:
description: "if set to true then the action don't cache or restore ~/.cache/go-build."
default: false
required: true
runs:
using: "node12"
main: "dist/run/index.js"

23508
dist/post_run/index.js vendored

File diff suppressed because one or more lines are too long

23510
dist/run/index.js vendored

File diff suppressed because one or more lines are too long

4544
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -26,28 +26,28 @@
"author": "golangci",
"license": "MIT",
"dependencies": {
"@actions/cache": "^1.0.2",
"@actions/cache": "^1.0.6",
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.1",
"@actions/github": "^4.0.0",
"@actions/tool-cache": "^1.6.0",
"@actions/tool-cache": "^1.6.1",
"@types/semver": "^7.3.4",
"@types/tmp": "^0.2.0",
"setup-go": "git+https://github.com/actions/setup-go.git#v2.1.3",
"tmp": "^0.2.1"
},
"devDependencies": {
"@types/node": "^14.11.10",
"@types/node": "^14.14.31",
"@types/uuid": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"@typescript-eslint/eslint-plugin": "^4.15.1",
"@typescript-eslint/parser": "^4.15.1",
"@zeit/ncc": "^0.22.3",
"eslint": "^6.6.0",
"eslint-config-prettier": "^6.13.0",
"eslint": "^7.20.0",
"eslint-config-prettier": "^8.0.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-simple-import-sort": "^5.0.2",
"prettier": "^2.1.2",
"typescript": "^4.0.3"
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-simple-import-sort": "^7.0.0",
"prettier": "^2.2.1",
"typescript": "^4.1.5"
}
}

View File

@ -25,7 +25,22 @@ const getLintCacheDir = (): string => {
const getCacheDirs = (): string[] => {
// Not existing dirs are ok here: it works.
return [getLintCacheDir(), path.resolve(`${process.env.HOME}/.cache/go-build`), path.resolve(`${process.env.HOME}/go/pkg`)]
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 => {

View File

@ -45,7 +45,12 @@ export async function installLint(versionConfig: VersionConfig): Promise<string>
extractedDir = await tc.extractZip(archivePath, process.env.HOME)
repl = /\.zip$/
} else {
extractedDir = await tc.extractTar(archivePath, process.env.HOME)
// We want to always overwrite files if the local cache already has them
const args = ["xz"]
if (process.platform.toString() != "darwin") {
args.push("--overwrite")
}
extractedDir = await tc.extractTar(archivePath, process.env.HOME, args)
}
const urlParts = assetURL.split(`/`)
@ -56,6 +61,12 @@ export async function installLint(versionConfig: VersionConfig): Promise<string>
}
export async function installGo(): Promise<void> {
const skipGoInstallation = core.getInput(`skip-go-installation`, { required: true }).trim()
if (skipGoInstallation.toLowerCase() == "true") {
core.info(`Skipping the installation of Go`)
return
}
const startedAt = Date.now()
process.env[`INPUT_GO-VERSION`] = `1`
await setupGo()

View File

@ -187,6 +187,7 @@ async function runLint(lintPath: string, patchPath: string): Promise<void> {
export async function run(): Promise<void> {
try {
const { lintPath, patchPath } = await core.group(`prepare environment`, prepareEnv)
core.addPath(path.dirname(lintPath))
await core.group(`run golangci-lint`, () => runLint(lintPath, patchPath))
} catch (error) {
core.error(`Failed to run: ${error}, ${error.stack}`)