-
Notifications
You must be signed in to change notification settings - Fork 8
76 lines (71 loc) · 3.17 KB
/
trivy-scan.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: vulnerability-wf
on:
push:
branches:
- "main"
paths:
- "**/*.lock"
- ".github/workflows/trivy-scan.yaml"
pull_request:
branches:
- "*"
paths:
- "**/*.lock"
- ".github/workflows/trivy-scan.yaml"
jobs:
changes:
runs-on: ubuntu-22.04
outputs:
changed_files: ${{ steps.verify-changed-files.outputs.all_changed_and_modified_files }}
any_changed: ${{ steps.verify-changed-files.outputs.all_changed_and_modified_files_count > 0 }}
steps:
- uses: actions/checkout@v4
- uses: tj-actions/[email protected]
id: verify-changed-files
with:
files: |
**/*.lock
scan-be:
needs: [changes]
if: ${{ github.event_name == 'push' || ( github.event_name == 'pull_request' && contains(needs.changes.outputs.changed_files, 'api/poetry.lock') ) }}
uses: radicalbit/radicalbit-github-workflows/.github/workflows/trivy-fs-scan.yaml@v1
with:
directory: ./api
prcomment: ${{ github.event_name == 'pull_request' && contains(needs.changes.outputs.changed_files, 'api/poetry.lock') }}
github_pr_url: ${{ github.event_name == 'pull_request' && github.event.pull_request.comments_url || '' }}
severity: "HIGH,CRITICAL"
secrets:
GIT_HUB_PAT: ${{ secrets.GIT_HUB_PAT }}
scan-sdk:
needs: [changes]
if: ${{ github.event_name == 'push' || ( github.event_name == 'pull_request' && contains(needs.changes.outputs.changed_files, 'sdk/poetry.lock') ) }}
uses: radicalbit/radicalbit-github-workflows/.github/workflows/trivy-fs-scan.yaml@v1
with:
directory: ./sdk
prcomment: ${{ github.event_name == 'pull_request' && contains(needs.changes.outputs.changed_files, 'sdk/poetry.lock') }}
github_pr_url: ${{ github.event_name == 'pull_request' && github.event.pull_request.comments_url || '' }}
severity: "HIGH,CRITICAL"
secrets:
GIT_HUB_PAT: ${{ secrets.GIT_HUB_PAT }}
scan-spark:
needs: [changes]
if: ${{ github.event_name == 'push' || ( github.event_name == 'pull_request' && contains(needs.changes.outputs.changed_files, 'spark/poetry.lock') ) }}
uses: radicalbit/radicalbit-github-workflows/.github/workflows/trivy-fs-scan.yaml@main
with:
directory: ./spark
prcomment: ${{ github.event_name == 'pull_request' && contains(needs.changes.outputs.changed_files, 'spark/poetry.lock') }}
github_pr_url: ${{ github.event_name == 'pull_request' && github.event.pull_request.comments_url || '' }}
severity: "HIGH,CRITICAL"
secrets:
GIT_HUB_PAT: ${{ secrets.GIT_HUB_PAT }}
scan-ui:
needs: [changes]
if: ${{ github.event_name == 'push' || ( github.event_name == 'pull_request' && contains(needs.changes.outputs.changed_files, 'ui/yarn.lock') ) }}
uses: radicalbit/radicalbit-github-workflows/.github/workflows/trivy-fs-scan.yaml@v1
with:
directory: ./ui
prcomment: ${{ github.event_name == 'pull_request' && contains(needs.changes.outputs.changed_files, 'ui/yarn.lock') }}
github_pr_url: ${{ github.event_name == 'pull_request' && github.event.pull_request.comments_url || '' }}
severity: "HIGH,CRITICAL"
secrets:
GIT_HUB_PAT: ${{ secrets.GIT_HUB_PAT }}