Skip to content

Commit 814cbb7

Browse files
jongioCopilot
andcommitted
feat: dispatch-parity quality improvements
- Pin all GitHub Actions to full commit SHAs - Add CODEOWNERS file - Add Dependabot for go modules and github-actions - Add concurrency control to CI/PR workflows - Add CodeQL security scanning workflow - Add govulncheck vulnerability scanning workflow - Standardize golangci-lint config with 30+ linters - Add dispatch-level linters (errname, exhaustive, forcetypeassert, etc.) - Add gofumpt strict formatting checks - Add deadcode detection - Add cosign code signing to release workflow - Add SBOM generation (SPDX + CycloneDX) to release workflow - Add comprehensive README badges (CI, CodeQL, Go Report Card, etc.) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 723ad0b commit 814cbb7

16 files changed

Lines changed: 286 additions & 92 deletions

File tree

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default code owners for all files
2+
* @jongio

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
commit-message:
8+
prefix: "deps"
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"
13+
commit-message:
14+
prefix: "ci"

.github/workflows/ci.yml

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
workflow_dispatch:
1010

1111
concurrency:
12-
group: ci-${{ github.ref }}
12+
group: ${{ github.workflow }}-${{ github.ref }}
1313
cancel-in-progress: true
1414

1515
defaults:
@@ -27,17 +27,17 @@ jobs:
2727

2828
steps:
2929
- name: Checkout code
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
3131

3232
- name: Set up Go
33-
uses: actions/setup-go@v5
33+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
3434
with:
3535
go-version: '${{ env.GO_VERSION }}'
3636
cache: true
3737
cache-dependency-path: cli/go.sum
3838

3939
- name: Cache Go tools
40-
uses: actions/cache@v4
40+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
4141
with:
4242
path: ~/go/bin
4343
key: go-tools-${{ runner.os }}-${{ env.GO_VERSION }}
@@ -73,10 +73,10 @@ jobs:
7373

7474
steps:
7575
- name: Checkout code
76-
uses: actions/checkout@v4
76+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
7777

7878
- name: Set up Go
79-
uses: actions/setup-go@v5
79+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
8080
with:
8181
go-version: '${{ env.GO_VERSION }}'
8282
cache: true
@@ -97,7 +97,7 @@ jobs:
9797
9898
- name: Upload coverage to Codecov
9999
if: github.repository == 'jongio/azd-exec'
100-
uses: codecov/codecov-action@v4
100+
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
101101
with:
102102
file: coverage/coverage.out
103103
flags: unittests
@@ -119,22 +119,8 @@ jobs:
119119
COVERAGE=$(go tool cover -func=../coverage/coverage.out | grep total | awk '{print $3}')
120120
echo "**Total Coverage: $COVERAGE**" >> $GITHUB_STEP_SUMMARY
121121
122-
build:
123-
name: Build
124-
runs-on: ubuntu-latest
125-
needs: [preflight, test]
126-
timeout-minutes: 30
127-
128-
defaults:
129-
run:
130-
working-directory: cli
131-
132-
steps:
133-
- name: Checkout code
134-
uses: actions/checkout@v4
135-
136122
- name: Set up Go
137-
uses: actions/setup-go@v5
123+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
138124
with:
139125
go-version: '${{ env.GO_VERSION }}'
140126
cache: true
@@ -149,7 +135,7 @@ jobs:
149135
GOOS=darwin GOARCH=arm64 go build -o bin/darwin-arm64/exec ./src/cmd/exec
150136
151137
- name: Upload artifacts
152-
uses: actions/upload-artifact@v4
138+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
153139
with:
154140
name: binaries
155141
path: cli/bin/
@@ -166,17 +152,17 @@ jobs:
166152

167153
steps:
168154
- name: Checkout code
169-
uses: actions/checkout@v4
155+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
170156

171157
- name: Set up Go
172-
uses: actions/setup-go@v5
158+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
173159
with:
174160
go-version: '${{ env.GO_VERSION }}'
175161
cache: true
176162
cache-dependency-path: cli/go.sum
177163

178164
- name: Set up Python
179-
uses: actions/setup-python@v5
165+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
180166
with:
181167
python-version: '3.11'
182168

@@ -198,7 +184,7 @@ jobs:
198184

199185
- name: Upload test logs on failure
200186
if: failure()
201-
uses: actions/upload-artifact@v4
187+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
202188
with:
203189
name: integration-test-logs-${{ matrix.os }}
204190
path: |

.github/workflows/codeql.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
schedule:
1313
- cron: '0 0 * * 0' # Weekly on Sundays
1414

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
1519
jobs:
1620
analyze:
1721
name: Analyze
@@ -29,19 +33,19 @@ jobs:
2933

3034
steps:
3135
- name: Checkout repository
32-
uses: actions/checkout@v4
36+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
3337

3438
- name: Initialize CodeQL
35-
uses: github/codeql-action/init@v3
39+
uses: github/codeql-action/init@9792ccaef0455e446c567163589397e8c3ac2e0d # v3
3640
with:
3741
languages: ${{ matrix.language }}
3842
queries: security-extended,security-and-quality
3943

4044
- name: Autobuild
41-
uses: github/codeql-action/autobuild@v3
45+
uses: github/codeql-action/autobuild@9792ccaef0455e446c567163589397e8c3ac2e0d # v3
4246

4347
- name: Perform CodeQL Analysis
44-
uses: github/codeql-action/analyze@v3
48+
uses: github/codeql-action/analyze@9792ccaef0455e446c567163589397e8c3ac2e0d # v3
4549
continue-on-error: true
4650
with:
4751
category: "/language:${{matrix.language}}"

.github/workflows/govulncheck.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Go Vulnerability Check
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: '0 0 * * 0' # Weekly on Sundays at midnight UTC
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
govulncheck:
20+
name: Run govulncheck
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
26+
27+
- name: Set up Go
28+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6
29+
with:
30+
go-version-file: cli/go.mod
31+
cache-dependency-path: cli/go.sum
32+
33+
- name: Install govulncheck
34+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
35+
36+
- name: Run govulncheck
37+
working-directory: cli
38+
run: govulncheck ./...

.github/workflows/pr-build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222
type: number
2323

2424
concurrency:
25-
group: pr-build-${{ github.event.pull_request.number || github.ref }}
25+
group: ${{ github.workflow }}-${{ github.ref }}
2626
cancel-in-progress: true
2727

2828
defaults:
@@ -57,7 +57,7 @@ jobs:
5757
steps:
5858
- name: Check if build is allowed
5959
id: check
60-
uses: actions/github-script@v7
60+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
6161
with:
6262
script: |
6363
let allowed = false;
@@ -168,7 +168,7 @@ jobs:
168168
steps:
169169
- name: Get PR details
170170
id: pr
171-
uses: actions/github-script@v7
171+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
172172
with:
173173
script: |
174174
const prNumber = '${{ needs.check-permission.outputs.pr_number }}' || context.payload.pull_request.number;
@@ -184,12 +184,12 @@ jobs:
184184
core.setOutput('title', pr.data.title);
185185
186186
- name: Checkout code
187-
uses: actions/checkout@v4
187+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
188188
with:
189189
ref: ${{ steps.pr.outputs.sha }}
190190

191191
- name: Set up Go
192-
uses: actions/setup-go@v5
192+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
193193
with:
194194
go-version: '${{ env.GO_VERSION }}'
195195
cache: true
@@ -334,7 +334,7 @@ jobs:
334334
EOF
335335
336336
- name: Comment on PR
337-
uses: actions/github-script@v7
337+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
338338
with:
339339
script: |
340340
const fs = require('fs');

.github/workflows/release-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ jobs:
3131

3232
steps:
3333
- name: Checkout
34-
uses: actions/checkout@v4
34+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
3535
with:
3636
fetch-depth: 0
3737

3838
- name: Set up Go
39-
uses: actions/setup-go@v5
39+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
4040
with:
4141
go-version: '${{ env.GO_VERSION }}'
4242
cache: true

0 commit comments

Comments
 (0)