Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
51485a4001 | |||
a12ae43dd8 | |||
f1dee55574 | |||
23487cb16f | |||
84560243ae | |||
3e54e516ae | |||
2f717c44f2 | |||
4a6ab128b0 | |||
f9b6927981 | |||
41858b8c7c | |||
67236c010b |
@ -15,8 +15,7 @@
|
|||||||
"plugin:import/errors",
|
"plugin:import/errors",
|
||||||
"plugin:import/warnings",
|
"plugin:import/warnings",
|
||||||
"plugin:import/typescript",
|
"plugin:import/typescript",
|
||||||
"plugin:prettier/recommended",
|
"plugin:prettier/recommended"
|
||||||
"prettier/@typescript-eslint"
|
|
||||||
],
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@typescript-eslint",
|
"@typescript-eslint",
|
||||||
|
@ -36,7 +36,7 @@ jobs:
|
|||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
with:
|
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
|
version: v1.29
|
||||||
|
|
||||||
# Optional: working directory, useful for monorepos
|
# Optional: working directory, useful for monorepos
|
||||||
|
1095
dist/post_run/index.js
vendored
1095
dist/post_run/index.js
vendored
File diff suppressed because one or more lines are too long
1095
dist/run/index.js
vendored
1095
dist/run/index.js
vendored
File diff suppressed because one or more lines are too long
2718
package-lock.json
generated
2718
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@ -37,17 +37,17 @@
|
|||||||
"tmp": "^0.2.1"
|
"tmp": "^0.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^14.14.25",
|
"@types/node": "^14.14.31",
|
||||||
"@types/uuid": "^8.3.0",
|
"@types/uuid": "^8.3.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^2.34.0",
|
"@typescript-eslint/eslint-plugin": "^4.15.1",
|
||||||
"@typescript-eslint/parser": "^2.34.0",
|
"@typescript-eslint/parser": "^4.15.1",
|
||||||
"@zeit/ncc": "^0.22.3",
|
"@zeit/ncc": "^0.22.3",
|
||||||
"eslint": "^6.6.0",
|
"eslint": "^7.20.0",
|
||||||
"eslint-config-prettier": "^6.15.0",
|
"eslint-config-prettier": "^8.0.0",
|
||||||
"eslint-plugin-import": "^2.22.1",
|
"eslint-plugin-import": "^2.22.1",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
"eslint-plugin-prettier": "^3.3.1",
|
||||||
"eslint-plugin-simple-import-sort": "^7.0.0",
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
||||||
"prettier": "^2.2.1",
|
"prettier": "^2.2.1",
|
||||||
"typescript": "^4.1.3"
|
"typescript": "^4.1.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,12 @@ export async function installLint(versionConfig: VersionConfig): Promise<string>
|
|||||||
extractedDir = await tc.extractZip(archivePath, process.env.HOME)
|
extractedDir = await tc.extractZip(archivePath, process.env.HOME)
|
||||||
repl = /\.zip$/
|
repl = /\.zip$/
|
||||||
} else {
|
} 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(`/`)
|
const urlParts = assetURL.split(`/`)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import * as core from "@actions/core"
|
import * as core from "@actions/core"
|
||||||
import * as httpm from "@actions/http-client"
|
import * as httpm from "@actions/http-client"
|
||||||
|
import * as fs from "fs"
|
||||||
|
|
||||||
// TODO: make a class
|
// TODO: make a class
|
||||||
export type Version = {
|
export type Version = {
|
||||||
@ -9,6 +10,7 @@ export type Version = {
|
|||||||
} | null
|
} | null
|
||||||
|
|
||||||
const versionRe = /^v(\d+)\.(\d+)(?:\.(\d+))?$/
|
const versionRe = /^v(\d+)\.(\d+)(?:\.(\d+))?$/
|
||||||
|
const modVersionRe = /github.com\/golangci\/golangci-lint\s(v.+)/
|
||||||
|
|
||||||
const parseVersion = (s: string): Version => {
|
const parseVersion = (s: string): Version => {
|
||||||
if (s == "latest" || s == "") {
|
if (s == "latest" || s == "") {
|
||||||
@ -56,7 +58,17 @@ const isLessVersion = (a: Version, b: Version): boolean => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getRequestedLintVersion = (): Version => {
|
const getRequestedLintVersion = (): Version => {
|
||||||
const requestedLintVersion = core.getInput(`version`)
|
let requestedLintVersion = core.getInput(`version`)
|
||||||
|
|
||||||
|
if (requestedLintVersion == "") {
|
||||||
|
const content = fs.readFileSync("go.mod", "utf-8")
|
||||||
|
const match = content.match(modVersionRe)
|
||||||
|
if (match) {
|
||||||
|
requestedLintVersion = match[1]
|
||||||
|
core.info(`Found golangci-lint version '${requestedLintVersion}' in go.mod`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const parsedRequestedLintVersion = parseVersion(requestedLintVersion)
|
const parsedRequestedLintVersion = parseVersion(requestedLintVersion)
|
||||||
if (parsedRequestedLintVersion == null) {
|
if (parsedRequestedLintVersion == null) {
|
||||||
return null
|
return null
|
||||||
|
Reference in New Issue
Block a user