Skip to content

Commit ae6311f

Browse files
authored
Add OpenSSF Scorecard Github Action and Badge (#265)
Closes #258
1 parent 641347d commit ae6311f

File tree

2 files changed

+61
-3
lines changed

2 files changed

+61
-3
lines changed

.github/workflows/scorecards.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Scorecards supply-chain security
2+
on:
3+
# Only the default branch is supported.
4+
branch_protection_rule:
5+
schedule:
6+
- cron: '27 5 * * 0'
7+
push:
8+
branches: [ "main" ]
9+
10+
# Declare default permissions as read only.
11+
permissions: read-all
12+
13+
jobs:
14+
analysis:
15+
name: Scorecards analysis
16+
runs-on: ubuntu-latest
17+
permissions:
18+
# Needed to upload the results to code-scanning dashboard.
19+
security-events: write
20+
# Used to receive a badge.
21+
id-token: write
22+
# Needs for private repositories.
23+
contents: read
24+
actions: read
25+
26+
steps:
27+
- name: "Checkout code"
28+
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0
29+
with:
30+
persist-credentials: false
31+
32+
- name: "Run analysis"
33+
uses: ossf/scorecard-action@e363bfca00e752f91de7b7d2a77340e2e523cb18 # tag=v2.0.4
34+
with:
35+
results_file: results.sarif
36+
results_format: sarif
37+
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
38+
39+
# Publish the results for public repositories to enable scorecard badges. For more details, see
40+
# https://github.com/ossf/scorecard-action#publishing-results.
41+
# For private repositories, `publish_results` will automatically be set to `false`, regardless
42+
# of the value entered here.
43+
publish_results: true
44+
45+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
46+
# format to the repository Actions tab.
47+
- name: "Upload artifact"
48+
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # tag=v3.0.0
49+
with:
50+
name: SARIF file
51+
path: results.sarif
52+
retention-days: 5
53+
54+
# Upload the results to GitHub's code scanning dashboard.
55+
- name: "Upload to code-scanning"
56+
uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # tag=v1.0.26
57+
with:
58+
sarif_file: results.sarif

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B5618%2Fgithub.com%2Fnginxinc%2Fnginx-kubernetes-gateway.svg?type=shield)](https://app.fossa.com/projects/custom%2B5618%2Fgithub.com%2Fnginxinc%2Fnginx-kubernetes-gateway?ref=badge_shield)
1+
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/nginxinc/nginx-kubernetes-gateway/badge)](https://api.securityscorecards.dev/projects/github.com/nginxinc/nginx-kubernetes-gateway) [![FOSSA Status](https://app.fossa.com/api/projects/custom%2B5618%2Fgithub.com%2Fnginxinc%2Fnginx-kubernetes-gateway.svg?type=shield)](https://app.fossa.com/projects/custom%2B5618%2Fgithub.com%2Fnginxinc%2Fnginx-kubernetes-gateway?ref=badge_shield)
22

33
# NGINX Kubernetes Gateway
44

@@ -14,7 +14,7 @@ For a list of supported Gateway API resources and features, see the [Gateway API
1414
1. [Quick Start on a kind cluster](docs/running-on-kind.md).
1515
2. [Install](docs/installation.md) NGINX Kubernetes Gateway.
1616
3. [Build](docs/building-the-image.md) an NGINX Kubernetes Gateway container image from source or use a pre-built image available on [GitHub Container Registry](https://github.com/nginxinc/nginx-kubernetes-gateway/pkgs/container/nginx-kubernetes-gateway).
17-
4. Deploy various [examples](examples).
17+
4. Deploy various [examples](examples).
1818

1919
## NGINX Kubernetes Gateway Releases
2020

@@ -55,4 +55,4 @@ Please read our [Contributing guide](CONTRIBUTING.md) if you'd like to contribut
5555

5656
## Support
5757

58-
NGINX Kubernetes Gateway is not covered by any support contract.
58+
NGINX Kubernetes Gateway is not covered by any support contract.

0 commit comments

Comments
 (0)