Skip to content

Commit 0dbaab6

Browse files
committed
Setup scorecard workflow
Signed-off-by: Matthieu MOREL <[email protected]>
1 parent 81d15e9 commit 0dbaab6

File tree

5 files changed

+69
-13
lines changed

5 files changed

+69
-13
lines changed

.github/workflows/commands.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Check out code
12-
uses: actions/checkout@v4
12+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1313

1414
- name: Re-Test Action
1515
uses: ./.github/actions/retest-action

.github/workflows/scorecard.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Scorecard supply-chain security
2+
on:
3+
branch_protection_rule:
4+
push:
5+
branches:
6+
- main
7+
schedule:
8+
- cron: 29 15 * * 0
9+
permissions: read-all
10+
jobs:
11+
analysis:
12+
name: Scorecard analysis
13+
permissions:
14+
id-token: write
15+
security-events: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
20+
with:
21+
persist-credentials: false
22+
23+
- name: Run analysis
24+
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
25+
with:
26+
results_file: results.sarif
27+
results_format: sarif
28+
publish_results: true
29+
30+
- name: Upload artifact
31+
uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
32+
with:
33+
name: SARIF file
34+
path: results.sarif
35+
retention-days: 5
36+
37+
- name: Upload to code-scanning
38+
uses: github/codeql-action/upload-sarif@f0f3afee809481da311ca3a6ff1ff51d81dbeb24 # v3.26.4
39+
with:
40+
sarif_file: results.sarif

.github/workflows/test.yaml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,39 @@ env:
1010
jobs:
1111
lint:
1212
name: Lint
13+
permissions:
14+
contents: read
15+
pull-requests: read
1316
runs-on: ubuntu-latest
1417
steps:
1518
- name: setup go
16-
uses: actions/setup-go@v5
19+
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
1720
with:
1821
go-version: ${{ env.GO_VERSION }}
19-
- uses: actions/checkout@v4
20-
- uses: ibiqlik/action-yamllint@v3
22+
23+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
24+
25+
- uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1
2126
with:
2227
format: auto
23-
- uses: golangci/golangci-lint-action@v6
28+
config_file: .yamllint.yaml
29+
30+
- uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
2431
with:
2532
args: --verbose
2633
version: v1.57.1
34+
2735
build:
2836
name: Build all linux architectures
2937
needs: lint
3038
runs-on: ubuntu-latest
3139
steps:
3240
- name: setup go
33-
uses: actions/setup-go@v5
41+
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
3442
with:
3543
go-version: ${{ env.GO_VERSION }}
36-
- uses: actions/checkout@v4
44+
45+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3746

3847
- name: Build on all supported architectures
3948
run: |
@@ -49,10 +58,11 @@ jobs:
4958
runs-on: ubuntu-latest
5059
steps:
5160
- name: setup go
52-
uses: actions/setup-go@v5
61+
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
5362
with:
5463
go-version: ${{ env.GO_VERSION }}
55-
- uses: actions/checkout@v4
64+
65+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
5666

5767
- name: Install test binaries
5868
run: |
@@ -62,9 +72,9 @@ jobs:
6272
- name: test
6373
run: COVERALLS=1 ./test.sh
6474

65-
- name: Send coverage to coveralls
66-
env:
75+
- env:
6776
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
name: Send coverage to coveralls
6878
run: |
6979
PATH=$PATH:$(go env GOPATH)/bin
7080
gover
@@ -76,9 +86,11 @@ jobs:
7686
runs-on: windows-latest
7787
steps:
7888
- name: setup go
79-
uses: actions/setup-go@v5
89+
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
8090
with:
8191
go-version: ${{ env.GO_VERSION }}
82-
- uses: actions/checkout@v4
92+
93+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
94+
8395
- name: test
8496
run: bash ./test.sh

.yamllint renamed to .yamllint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ extends: default
33

44
rules:
55
document-start: disable
6+
line-length: disable
67
truthy:
78
ignore: |
89
.github/workflows/*.yml

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
# CNI - the Container Network Interface
66

7+
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/2446/badge)](https://bestpractices.coreinfrastructure.org/projects/2446)
8+
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/containernetworking/cni/badge)](https://securityscorecards.dev/viewer/?uri=github.com/containernetworking/cni)
9+
710
## What is CNI?
811

912
CNI (_Container Network Interface_), a [Cloud Native Computing Foundation](https://cncf.io) project, consists of a specification and libraries for writing plugins to configure network interfaces in Linux containers, along with a number of supported plugins.

0 commit comments

Comments
 (0)