Skip to content

Commit 352b4ec

Browse files
authored
Create scorecard.yaml (#832)
* Create scorecard.yaml * Add scorecard badge
1 parent f4cd35e commit 352b4ec

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

.github/workflows/scorecard.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Copyright (C) The DDC development team, see COPYRIGHT.md file
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
---
6+
name: Scorecard supply-chain security
7+
8+
# This workflow uses actions that are not certified by GitHub. They are provided
9+
# by a third-party and are governed by separate terms of service, privacy
10+
# policy, and support documentation.
11+
12+
# yamllint disable-line rule:truthy
13+
on:
14+
# For Branch-Protection check. Only the default branch is supported. See
15+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
16+
branch_protection_rule:
17+
# To guarantee Maintained check is occasionally updated. See
18+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
19+
schedule:
20+
- cron: '18 9 * * 2'
21+
push:
22+
branches:
23+
- "main"
24+
25+
# Declare default permissions as read only.
26+
permissions: read-all
27+
28+
jobs:
29+
analysis:
30+
name: Scorecard analysis
31+
runs-on: ubuntu-latest
32+
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
33+
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
34+
permissions:
35+
# Needed to upload the results to code-scanning dashboard.
36+
security-events: write
37+
# Needed to publish results and get a badge (see publish_results below).
38+
id-token: write
39+
40+
steps:
41+
- name: "Checkout code"
42+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
43+
with:
44+
persist-credentials: false
45+
46+
- name: "Run analysis"
47+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
48+
with:
49+
results_file: results.sarif
50+
results_format: sarif
51+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
52+
# - you want to enable the Branch-Protection check on a *public* repository, or
53+
# - you are installing Scorecard on a *private* repository
54+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
55+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
56+
57+
# Public repositories:
58+
# - Publish results to OpenSSF REST API for easy access by consumers
59+
# - Allows the repository to include the Scorecard badge.
60+
# - See https://github.com/ossf/scorecard-action#publishing-results.
61+
# For private repositories:
62+
# - `publish_results` will always be set to `false`, regardless
63+
# of the value entered here.
64+
publish_results: true
65+
66+
# (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore
67+
# file_mode: git
68+
69+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
70+
# format to the repository Actions tab.
71+
- name: "Upload artifact"
72+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
73+
with:
74+
name: SARIF file
75+
path: results.sarif
76+
retention-days: 5
77+
78+
# Upload the results to GitHub's code scanning dashboard (optional).
79+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
80+
- name: "Upload to code-scanning"
81+
uses: github/codeql-action/upload-sarif@v3
82+
with:
83+
sarif_file: results.sarif

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Copyright (C) The DDC development team, see COPYRIGHT.md file
55
SPDX-License-Identifier: MIT
66
-->
77

8+
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/CExA-project/ddc/badge)](https://scorecard.dev/viewer/?uri=github.com/CExA-project/ddc)
89
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
910
[![Nightly early integration](https://github.com/CExA-project/ddc/actions/workflows/early_integration.yaml/badge.svg?event=schedule)](https://github.com/CExA-project/ddc/actions/workflows/early_integration.yaml)
1011
[![Nightly tests on Ubuntu](https://github.com/CExA-project/ddc/actions/workflows/tests-ubuntu.yaml/badge.svg?event=schedule)](https://github.com/CExA-project/ddc/actions/workflows/tests-ubuntu.yaml)

0 commit comments

Comments
 (0)