Skip to content

Commit 494a052

Browse files
Create scorecard.yml (#158)
1 parent 26ed564 commit 494a052

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/scorecard.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on:
2+
# For Branch-Protection check. Only the default branch is supported. See
3+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
4+
branch_protection_rule:
5+
# To guarantee Maintained check is occasionally updated. See
6+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
7+
schedule:
8+
- cron: '20 19 * * 3'
9+
push:
10+
branches: [ "master" ]
11+
pull_request:
12+
branches: [ "master" ]
13+
14+
permissions: read-all
15+
16+
jobs:
17+
analysis:
18+
runs-on: ubuntu-latest
19+
if: github.repository_owner == 'oneapi-src'
20+
permissions:
21+
# Needed to upload the results to code-scanning dashboard.
22+
security-events: write
23+
# Needed to publish results and get a badge (see publish_results below).
24+
id-token: write
25+
steps:
26+
- name: "Checkout code"
27+
uses: actions/checkout@v4
28+
with:
29+
persist-credentials: false
30+
- name: "Run analysis"
31+
uses: ossf/[email protected]
32+
with:
33+
results_file: results.sarif
34+
results_format: sarif
35+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
36+
# - you want to enable the Branch-Protection check on a *public* repository, or
37+
# - you are installing Scorecard on a *private* repository
38+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
39+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
40+
publish_results: true
41+
- name: "Upload artifact"
42+
uses: actions/upload-artifact@v3
43+
with:
44+
name: SARIF file
45+
path: results.sarif
46+
- name: "Upload to code-scanning"
47+
if: github.event_name != 'pull_request'
48+
uses: github/codeql-action/upload-sarif@v3
49+
with:
50+
sarif_file: results.sarif

0 commit comments

Comments
 (0)