Skip to content

Commit 3b8e36c

Browse files
authored
Add CodeQL scanning for Actions, Dependabot updates for go.mod (#26)
Also, this removes `go.work` files because: 1. Dependabot does not support updating this. 2. This file is not recommended to be checked into version control.
1 parent c29f529 commit 3b8e36c

12 files changed

Lines changed: 90 additions & 186 deletions

File tree

.github/PklProject

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ amends "pkl:Project"
1818

1919
dependencies {
2020
["pkl.impl.ghactions"] {
21-
uri = "package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1.5.0"
21+
uri = "package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1.7.1"
2222
}
2323
["com.github.actions"] {
24-
uri = "package://pkg.pkl-lang.org/pkl-pantry/com.github.actions@1.3.0"
24+
uri = "package://pkg.pkl-lang.org/pkl-pantry/com.github.actions@1.6.0"
2525
}
2626
}

.github/PklProject.deps.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
"resolvedDependencies": {
44
"package://pkg.pkl-lang.org/pkl-pantry/com.github.actions@1": {
55
"type": "remote",
6-
"uri": "projectpackage://pkg.pkl-lang.org/pkl-pantry/com.github.actions@1.3.1",
6+
"uri": "projectpackage://pkg.pkl-lang.org/pkl-pantry/com.github.actions@1.6.0",
77
"checksums": {
8-
"sha256": "fd515da685ea126678c3ec684e84a4f992d43481cc1d75cb866cd55775f675f9"
8+
"sha256": "10e27d63df4a4520d8a9375962406ca5ffe74f396bd3cb1c19b1f8358505010a"
99
}
1010
},
1111
"package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1": {
1212
"type": "remote",
13-
"uri": "projectpackage://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1.5.0",
13+
"uri": "projectpackage://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1.7.1",
1414
"checksums": {
15-
"sha256": "2c1e0d9efcd65b3c3207bf535c325ebc0ec2ab169187b324c4bb70821cac0e51"
15+
"sha256": "93cdf1bdd3e7f6c1c83f49791b8c02fbee9ac2e721d299cad6c15d142fd5d762"
1616
}
1717
},
1818
"package://pkg.pkl-lang.org/pkl-pantry/pkl.experimental.deepToTyped@1": {
@@ -24,16 +24,16 @@
2424
},
2525
"package://pkg.pkl-lang.org/pkl-pantry/pkl.github.dependabotManagedActions@1": {
2626
"type": "remote",
27-
"uri": "projectpackage://pkg.pkl-lang.org/pkl-pantry/pkl.github.dependabotManagedActions@1.0.3",
27+
"uri": "projectpackage://pkg.pkl-lang.org/pkl-pantry/pkl.github.dependabotManagedActions@1.1.3",
2828
"checksums": {
29-
"sha256": "d368900942efb88ed51a98f9614748b06c74ba43423f045fcd6dedb5dbdc0bea"
29+
"sha256": "521feb6f5ff12075ebad0758799fe7ec2675d231a0e0f5456694c8d4822a8171"
3030
}
3131
},
3232
"package://pkg.pkl-lang.org/pkl-pantry/com.github.dependabot@1": {
3333
"type": "remote",
34-
"uri": "projectpackage://pkg.pkl-lang.org/pkl-pantry/com.github.dependabot@1.0.0",
34+
"uri": "projectpackage://pkg.pkl-lang.org/pkl-pantry/com.github.dependabot@1.0.4",
3535
"checksums": {
36-
"sha256": "02ef6f25bfca5b1d095db73ea15de79d2d2c6832ebcab61e6aba90554382abcb"
36+
"sha256": "c7391119f946d7761d0ca0cc358ed8fe2bdfc691411087ccac89637bd96fec4a"
3737
}
3838
}
3939
}

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
version: 2
22
updates:
3+
- package-ecosystem: gomod
4+
cooldown:
5+
default-days: 7
6+
exclude:
7+
- github.com/apple/pkl-go
8+
directories:
9+
- /buildtimeeval
10+
- /simple
11+
schedule:
12+
interval: weekly
313
- package-ecosystem: github-actions
14+
cooldown:
15+
default-days: 7
416
directory: /
517
ignore:
618
- dependency-name: '*'

.github/index.pkl

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,23 @@ local test: Workflow = new {
3131
with {
3232
`go-version` = "1.26"
3333
`check-latest` = true
34-
`cache-dependency-path` = "go.work.sum"
3534
}
3635
}
3736
new SetupPkl { version = "0.31.0" }.step
3837
new {
3938
name = "go generate"
4039
run =
40+
// language=bash
4141
"""
42-
go list -f '{{.Dir}}/...' -m | xargs go generate
42+
find . -name 'go.mod' -execdir go generate ./... \\;
4343
"""
4444
}
4545
new {
4646
name = "go test"
4747
run =
48+
// language=bash
4849
"""
49-
go list -f '{{.Dir}}/...' -m | xargs go test
50+
find . -name 'go.mod' -execdir go test ./... \\;
5051
"""
5152
}
5253
new {
@@ -67,3 +68,24 @@ prb = test
6768
build = test
6869

6970
main = test
71+
72+
dependabot {
73+
updates {
74+
new {
75+
`package-ecosystem` = "gomod"
76+
directories {
77+
"/buildtimeeval"
78+
"/simple"
79+
}
80+
cooldown {
81+
`default-days` = 7
82+
exclude {
83+
"github.com/apple/pkl-go"
84+
}
85+
}
86+
schedule {
87+
interval = "weekly"
88+
}
89+
}
90+
}
91+
}

.github/workflows/__lockfile__.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ jobs:
2222
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
2323
- name: actions/upload-artifact@v5
2424
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
25+
- name: github/codeql-action/analyze@v4
26+
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
27+
- name: github/codeql-action/init@v4
28+
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4

.github/workflows/build.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
with:
2525
go-version: '1.26'
2626
check-latest: true
27-
cache-dependency-path: go.work.sum
2827
- name: Setup Pkl
2928
id: setup-pkl
3029
env:
@@ -40,9 +39,9 @@ jobs:
4039
echo "$DIR" >> "$GITHUB_PATH"
4140
echo "pkl_exec=$PKL_EXEC" >> "$GITHUB_OUTPUT"
4241
- name: go generate
43-
run: go list -f '{{.Dir}}/...' -m | xargs go generate
42+
run: find . -name 'go.mod' -execdir go generate ./... \;
4443
- name: go test
45-
run: go list -f '{{.Dir}}/...' -m | xargs go test
44+
run: find . -name 'go.mod' -execdir go test ./... \;
4645
- name: pkl format
4746
run: pkl format --diff-name-only .
4847
hawkeye-check:

.github/workflows/codeql.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Generated from Workflow.pkl. DO NOT EDIT.
2+
'on':
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
branches:
8+
- main
9+
schedule:
10+
- cron: 29 17 * * 4
11+
jobs:
12+
analyze-actions:
13+
name: Analyze (actions)
14+
permissions:
15+
security-events: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
19+
with:
20+
persist-credentials: false
21+
- uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
22+
with:
23+
languages: actions
24+
build-mode: none
25+
- name: Perform CodeQL Analysis
26+
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
27+
with:
28+
category: /language:actions

.github/workflows/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
with:
2323
go-version: '1.26'
2424
check-latest: true
25-
cache-dependency-path: go.work.sum
2625
- name: Setup Pkl
2726
id: setup-pkl
2827
env:
@@ -38,9 +37,9 @@ jobs:
3837
echo "$DIR" >> "$GITHUB_PATH"
3938
echo "pkl_exec=$PKL_EXEC" >> "$GITHUB_OUTPUT"
4039
- name: go generate
41-
run: go list -f '{{.Dir}}/...' -m | xargs go generate
40+
run: find . -name 'go.mod' -execdir go generate ./... \;
4241
- name: go test
43-
run: go list -f '{{.Dir}}/...' -m | xargs go test
42+
run: find . -name 'go.mod' -execdir go test ./... \;
4443
- name: pkl format
4544
run: pkl format --diff-name-only .
4645
hawkeye-check:

.github/workflows/prb.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
with:
1919
go-version: '1.26'
2020
check-latest: true
21-
cache-dependency-path: go.work.sum
2221
- name: Setup Pkl
2322
id: setup-pkl
2423
env:
@@ -34,9 +33,9 @@ jobs:
3433
echo "$DIR" >> "$GITHUB_PATH"
3534
echo "pkl_exec=$PKL_EXEC" >> "$GITHUB_OUTPUT"
3635
- name: go generate
37-
run: go list -f '{{.Dir}}/...' -m | xargs go generate
36+
run: find . -name 'go.mod' -execdir go generate ./... \;
3837
- name: go test
39-
run: go list -f '{{.Dir}}/...' -m | xargs go test
38+
run: find . -name 'go.mod' -execdir go test ./... \;
4039
- name: pkl format
4140
run: pkl format --diff-name-only .
4241
hawkeye-check:

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22
.DS_Store
33
.pkl-lsp/
44

5-
*.msgpack
5+
*.msgpack
6+
7+
# go.work files aren't meant to be checked into version control.
8+
go.work
9+
go.work.sum

0 commit comments

Comments
 (0)