Skip to content

Commit 1dd93d0

Browse files
authored
chore: use new assets file (#1154)
1 parent 5421a11 commit 1dd93d0

File tree

6 files changed

+38
-9
lines changed

6 files changed

+38
-9
lines changed

Diff for: .github/workflows/codeql.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ name: "Code Scanning - Action"
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- master
7+
- main
68
pull_request:
79
# The branches below must be a subset of the branches above
8-
branches: [ master ]
10+
branches:
11+
- master
12+
- main
913
schedule:
1014
- cron: '0 17 * * 5'
1115

Diff for: .github/workflows/test.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
name: "build-and-test"
22
on: # rebuild any PRs and main branch changes
33
pull_request:
4+
branches:
5+
- master
6+
- main
47
push:
58
branches:
69
- master
10+
- main
711
- "releases/*"
812

913
jobs:
@@ -53,8 +57,8 @@ jobs:
5357
version:
5458
- ""
5559
- "latest"
56-
- "v1.60"
57-
- "v1.60.1"
60+
- "v1.60" # TODO(ldez): it should be updated for v2.
61+
- "v1.60.1" # TODO(ldez): it should be updated for v2.
5862
runs-on: ${{ matrix.os }}
5963
permissions:
6064
contents: read
@@ -82,8 +86,8 @@ jobs:
8286
version:
8387
- ""
8488
- "latest"
85-
- "v1.60.1"
86-
- "adbdfdb288e939a175182b7a12b7555215ce98b2"
89+
- "v1.60.1" # TODO(ldez): it should be updated for v2.
90+
- "adbdfdb288e939a175182b7a12b7555215ce98b2" # TODO(ldez): it should be updated for v2.
8791
runs-on: ${{ matrix.os }}
8892
permissions:
8993
contents: read

Diff for: dist/post_run/index.js

+8-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/run/index.js

+8-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/install.ts

+2
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,14 @@ export async function goInstall(versionConfig: VersionConfig): Promise<string> {
9191

9292
const options: ExecOptions = { env: { ...process.env, CGO_ENABLED: "1" } }
9393

94+
// TODO(ldez): it should be updated for v2.
9495
const exres = await execShellCommand(
9596
`go install github.com/golangci/golangci-lint/cmd/golangci-lint@${versionConfig.TargetVersion}`,
9697
options
9798
)
9899
printOutput(exres)
99100

101+
// TODO(ldez): it should be updated for v2.
100102
const res = await execShellCommand(
101103
`go install -n github.com/golangci/golangci-lint/cmd/golangci-lint@${versionConfig.TargetVersion}`,
102104
options

Diff for: src/version.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const modVersionRe = /github.com\/golangci\/golangci-lint\s(v.+)/
1818

1919
const parseVersion = (s: string): Version => {
2020
if (s == "latest" || s == "") {
21+
// TODO(ldez): it should be replaced with an explicit version (ex: v1.64.0)
2122
return null
2223
}
2324

@@ -40,6 +41,7 @@ export const stringifyVersion = (v: Version): string => {
4041
return `v${v.major}.${v.minor}${v.patch !== null ? `.${v.patch}` : ``}`
4142
}
4243

44+
// TODO(ldez): it should be updated to v2.0.0.
4345
const minVersion = {
4446
major: 1,
4547
minor: 28,
@@ -114,7 +116,8 @@ const getConfig = async (): Promise<Config> => {
114116
maxRetries: 5,
115117
})
116118
try {
117-
const url = `https://raw.githubusercontent.com/golangci/golangci-lint/master/assets/github-action-config.json`
119+
// TODO(ldez): HEAD should be replaced with an explicit version (ex: v1.64.0).
120+
const url = `https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/assets/github-action-config-v1.json`
118121
const response: httpm.HttpClientResponse = await http.get(url)
119122
if (response.message.statusCode !== 200) {
120123
throw new Error(`failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`)
@@ -132,6 +135,8 @@ export async function findLintVersion(mode: InstallMode): Promise<VersionConfig>
132135

133136
if (mode == InstallMode.GoInstall) {
134137
const v: string = core.getInput(`version`)
138+
// TODO(ldez): latest should be replaced with an explicit version (ex: v1.64.0).
139+
// TODO(ldez): AssetURL should be updated for v2.
135140
return { TargetVersion: v ? v : "latest", AssetURL: "github.com/golangci/golangci-lint" }
136141
}
137142

0 commit comments

Comments
 (0)