Skip to content

Commit c36a930

Browse files
committed
ci: add security
1 parent 61cfd33 commit c36a930

File tree

4 files changed

+66
-3
lines changed

4 files changed

+66
-3
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
uses: actions/checkout@v4
2626
with:
2727
fetch-depth: 0
28+
persist-credentials: false
2829
token: ${{ secrets.TOKEN }}
2930

3031
- name: Import GPG

.github/workflows/security.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Security
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- '[0-9].[0-9].x'
7+
- '[0-9].x.x'
8+
- '[0-9].x'
9+
- main
10+
- next
11+
- rc
12+
- beta
13+
- alpha
14+
15+
jobs:
16+
security:
17+
name: Security
18+
runs-on: ubuntu-latest
19+
permissions:
20+
actions: read
21+
contents: read
22+
id-token: write
23+
security-events: write
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
language: [javascript, typescript]
28+
steps:
29+
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
with:
33+
persist-credentials: false
34+
token: ${{ secrets.TOKEN }}
35+
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@v3
38+
with:
39+
languages: ${{ matrix.language }}
40+
41+
- name: Analyze CodeQL
42+
uses: github/codeql-action/analyze@v3
43+
44+
- name: Analyze OSSF Scorecard
45+
uses: ossf/scorecard-action@v2
46+
with:
47+
results_file: ossf_scorecard.sarif
48+
results_format: sarif
49+
repo_token: ${{ secrets.TOKEN }}
50+
publish_results: true
51+
52+
- name: Upload to GitHub Actions Artifact
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: OSSF Scorecard
56+
path: ossf_scorecard.sarif
57+
58+
- name: Upload to GitHub Code Scanning
59+
uses: github/codeql-action/upload-sarif@v3
60+
with:
61+
sarif_file: ossf_scorecard.sarif

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
uses: actions/checkout@v4
2323
with:
2424
fetch-depth: 2 # At least fetch the last two commits for comparison
25+
persist-credentials: false
2526

2627
- name: Setup Node
2728
uses: actions/setup-node@v4

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)