Skip to content

Commit 7d36175

Browse files
author
Yoan Moscatelli
committed
⚗️ sarif and gh
1 parent 7cf6517 commit 7d36175

File tree

3 files changed

+86
-45
lines changed

3 files changed

+86
-45
lines changed

.github/workflows/nightly.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: "nightly"
2+
run-name: "Nightly tests for ${{ github.ref_name }}"
3+
4+
on:
5+
schedule:
6+
- cron: "22 0 * * *" # Runs daily at 22:00 UTC
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
update-scanners:
14+
runs-on: ubuntu-24.04
15+
steps:
16+
17+
- name: Create github token
18+
uses: actions/create-github-app-token@v1
19+
id: app-token
20+
with:
21+
app-id: ${{ vars.ACTIONS_APP_ID }}
22+
private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }}
23+
owner: ${{ github.repository_owner }}
24+
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
token: ${{ steps.app-token.outputs.token }}
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: 3.12
34+
35+
- name: Install dependencies
36+
run: pip install requests
37+
38+
- name: Update scanner versions
39+
run: python .github/scripts/update_scanners.py
40+
41+
- name: Create Pull Request
42+
uses: peter-evans/create-pull-request@v7
43+
id: pr
44+
with:
45+
title: Dependency update
46+
branch: feature/deps-update
47+
delete-branch: true
48+
commit-message: ":arrow_up: Update scanner versions"
49+
token: ${{ steps.app-token.outputs.token }}
50+
51+
vuln-scan:
52+
permissions:
53+
contents: read # for actions/checkout to fetch code
54+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
55+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
56+
runs-on: ubuntu-24.04
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v4
60+
with:
61+
path: ./
62+
fetch-depth: 0
63+
fetch-tags: true
64+
65+
- name: Create SBOM
66+
uses: anchore/sbom-action@v0
67+
with:
68+
path: ./
69+
format: cyclonedx-json
70+
output-file: "${{ github.event.repository.name }}-sbom.cdx.json"
71+
72+
- name: Scan SBOM
73+
uses: anchore/scan-action@v6
74+
id: scan
75+
with:
76+
sbom: "${{ github.event.repository.name }}-sbom.cdx.json"
77+
output-format: sarif
78+
fail-build: false
79+
add-cpes-if-none: true
80+
by-cve: true
81+
82+
- name: Upload SARIF report
83+
uses: github/codeql-action/upload-sarif@v3
84+
with:
85+
sarif_file: ${{ steps.scan.outputs.sarif }}

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
jobs:
77
test-as-action:
8-
runs-on: ubuntu-22.04
8+
runs-on: ubuntu-24.04
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v4

.github/workflows/update_scanners.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)