Skip to content

Commit 630fb71

Browse files
committed
Merge branch 'main' of https://github.com/ChristopherHX/github-act-runner into move-to-actions-oss-runtime
2 parents 1307479 + 18bf9e0 commit 630fb71

38 files changed

Lines changed: 1651 additions & 1100 deletions

.github/workflows/lint.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Go Lint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.21'
22+
23+
- name: Cache Go modules
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
~/.cache/go-build
28+
~/go/pkg/mod
29+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
30+
restore-keys: |
31+
${{ runner.os }}-go-
32+
33+
- name: Download dependencies
34+
run: go mod download
35+
36+
- name: Run golangci-lint
37+
uses: golangci/golangci-lint-action@v8
38+
with:
39+
version: latest
40+
args: --timeout=5m

.golangci.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
version: "2"
2+
run:
3+
go: "1.24"
4+
linters:
5+
enable:
6+
- asciicheck
7+
- bidichk
8+
- bodyclose
9+
- copyloopvar
10+
- dogsled
11+
- dupl
12+
- durationcheck
13+
- errname
14+
- errorlint
15+
- exhaustive
16+
- gocheckcompilerdirectives
17+
- goconst
18+
- gocritic
19+
- goprintffuncname
20+
- gosec
21+
- importas
22+
- lll
23+
- makezero
24+
- misspell
25+
- mnd
26+
- nakedret
27+
- nilerr
28+
- noctx
29+
- nolintlint
30+
- prealloc
31+
- revive
32+
- rowserrcheck
33+
- staticcheck
34+
- tparallel
35+
- unconvert
36+
- unparam
37+
- usestdlibvars
38+
- whitespace
39+
settings:
40+
dupl:
41+
threshold: 100
42+
goconst:
43+
min-len: 2
44+
min-occurrences: 2
45+
gocritic:
46+
disabled-checks:
47+
- dupImport
48+
- ifElseChain
49+
- octalLiteral
50+
- whyNoLint
51+
- wrapperFunc
52+
enabled-tags:
53+
- diagnostic
54+
- experimental
55+
- opinionated
56+
- performance
57+
- style
58+
gocyclo:
59+
min-complexity: 15
60+
govet:
61+
enable:
62+
- shadow
63+
lll:
64+
line-length: 140
65+
misspell:
66+
locale: US
67+
revive:
68+
confidence: 0.8
69+
exclusions:
70+
generated: lax
71+
rules:
72+
- linters:
73+
- gocritic
74+
- gosec
75+
- mnd
76+
path: _test\.go
77+
- linters:
78+
- mnd
79+
path: main\.go
80+
- linters:
81+
- revive
82+
path: protocol/
83+
- linters:
84+
- gosec
85+
text: weak cryptographic primitive
86+
- linters:
87+
- gosec
88+
text: Use of weak random number generator
89+
- linters:
90+
- staticcheck
91+
text: at least one file in a package should have a package comment
92+
- linters:
93+
- staticcheck
94+
text: should have a package comment
95+
- linters:
96+
- revive
97+
text: 'package-comments: should have a package comment'
98+
- linters:
99+
- revive
100+
text: exported function .* should have comment or be unexported
101+
- linters:
102+
- revive
103+
text: exported method .* should have comment or be unexported
104+
- linters:
105+
- revive
106+
text: exported type .* should have comment or be unexported
107+
- linters:
108+
- revive
109+
text: exported var .* should have comment or be unexported
110+
paths:
111+
- third_party$
112+
- builtin$
113+
- examples$
114+
issues:
115+
max-issues-per-linter: 0
116+
max-same-issues: 0
117+
formatters:
118+
enable:
119+
- gofmt
120+
- gofumpt
121+
- goimports
122+
settings:
123+
goimports:
124+
local-prefixes:
125+
- github.com/ChristopherHX/github-act-runner
126+
exclusions:
127+
generated: lax
128+
paths:
129+
- third_party$
130+
- builtin$
131+
- examples$

actionsdotnetactcompat/act_runner.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ type ActRunner struct {
99
actionsrunner.WorkerRunnerEnvironment
1010
}
1111

12-
func (arunner *ActRunner) ExecWorker(run *actionsrunner.RunRunner, wc actionsrunner.WorkerContext, jobreq *protocol.AgentJobRequestMessage, src []byte) error {
13-
if len(arunner.WorkerArgs) <= 0 {
12+
func (arunner *ActRunner) ExecWorker(run *actionsrunner.RunRunner, wc actionsrunner.WorkerContext,
13+
jobreq *protocol.AgentJobRequestMessage, src []byte,
14+
) error {
15+
if len(arunner.WorkerArgs) == 0 {
1416
ExecWorker(jobreq, wc)
1517
return nil
1618
}

0 commit comments

Comments
 (0)