Skip to content

Commit ee4ddf9

Browse files
ENH: Add vulnerability scan workflow with grype
* Add GitHub Actions workflow that runs a vulnerability scan with grype (https://github.com/anchore/grype) on the conda packages in the Pixi environment. Check for vulnerabilities across all installed packages, both those with and without fixes, and then check for vulnerabilities that do have known fixes as a more restrictive failure setting.
1 parent 7c719ad commit ee4ddf9

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/grype.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Vulnerability scans
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'pixi.lock'
9+
- '.github/workflows/grype.yml'
10+
pull_request:
11+
paths:
12+
- 'pixi.lock'
13+
- '.github/workflows/grype.yml'
14+
schedule:
15+
# Sunday at 01:59 UTC
16+
- cron: '59 01 * * 0'
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
grype-scan:
25+
name: "Scan action pixi environment"
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
31+
- name: Set up pixi
32+
uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
33+
34+
- name: Scan with grype (for all vulnerabilities)
35+
run: pixi exec grype .pixi/envs/default --fail-on critical
36+
37+
- name: Scan with grype (for fixed vulnerabilities)
38+
run: pixi exec grype .pixi/envs/default --only-fixed --fail-on high

0 commit comments

Comments
 (0)