@@ -55,34 +55,44 @@ jobs:
55
55
echo "SHA: ${{ github.event.pull_request.head.sha }}"
56
56
echo "MAIN IMAGE AT: ${{ vars.QUAY_RELEASE_REPO }}:latest"
57
57
echo "CI IMAGE AT: quay.io/trustyai/guardrails-detector-huggingface-runtime-ci:${{ github.event.pull_request.head.sha }}"
58
+ echo "Built-In Detector CI IMAGE AT: quay.io/trustyai/regex-detector-ci:${{ github.event.pull_request.head.sha }}"
58
59
59
60
# Set environments depending on context
60
61
- name : Set CI environment
61
62
if : env.BUILD_CONTEXT == 'ci'
62
63
run : |
63
64
echo "TAG=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
64
65
echo "IMAGE_NAME=quay.io/trustyai/guardrails-detector-huggingface-runtime-ci" >> $GITHUB_ENV
66
+ echo "BUILTIN_IMAGE_NAME=quay.io/trustyai/regex-detector-ci" >> $GITHUB_ENV
65
67
- name : Set main-branch environment
66
68
if : env.BUILD_CONTEXT == 'main'
67
69
run : |
68
70
echo "TAG=latest" >> $GITHUB_ENV
69
71
echo "IMAGE_NAME=${{ vars.QUAY_RELEASE_REPO }}" >> $GITHUB_ENV
72
+ echo "BUILTIN_IMAGE_NAME=quay.io/trustyai/regex-detector" >> $GITHUB_ENV
70
73
- name : Set tag environment
71
74
if : env.BUILD_CONTEXT == 'tag'
72
75
run : |
73
76
echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV
74
77
echo "IMAGE_NAME=${{ vars.QUAY_RELEASE_REPO }}" >> $GITHUB_ENV
78
+ echo "BUILTIN_IMAGE_NAME=quay.io/trustyai/regex-detector" >> $GITHUB_ENV
75
79
#
76
80
# Run docker commands
77
81
- name : Put expiry date on CI-tagged image
78
82
if : env.BUILD_CONTEXT == 'ci'
79
- run : echo 'LABEL quay.expires-after=7d#' >> detectors/Dockerfile.hf
83
+ run : |
84
+ echo 'LABEL quay.expires-after=7d#' >> detectors/Dockerfile.hf
85
+ echo 'LABEL quay.expires-after=7d#' >> detectors/Dockerfile.builtIn
80
86
- name : Build image
81
87
run : docker build -t ${{ env.IMAGE_NAME }}:$TAG -f detectors/Dockerfile.hf detectors
82
88
- name : Log in to Quay
83
89
run : docker login -u ${{ secrets.QUAY_ROBOT_USERNAME }} -p ${{ secrets.QUAY_ROBOT_SECRET }} quay.io
84
90
- name : Push to Quay CI repo
85
91
run : docker push ${{ env.IMAGE_NAME }}:$TAG
92
+ - name : Build built-in detector image
93
+ run : docker build -t ${{ env.BUILTIN_IMAGE_NAME }}:$TAG -f detectors/Dockerfile.builtIn detectors
94
+ - name : Push to Quay CI repo
95
+ run : docker push ${{ env.BUILTIN_IMAGE_NAME }}:$TAG
86
96
87
97
# Leave comment
88
98
- uses : peter-evans/find-comment@v3
@@ -104,6 +114,7 @@ jobs:
104
114
PR image build completed successfully!
105
115
106
116
📦 [PR image](https://quay.io/repository/trustyai/guardrails-detector-huggingface-runtime-ci?tab=tags): `quay.io/trustyai/guardrails-detector-huggingface-runtime-ci:${{ github.event.pull_request.head.sha }}`
117
+ 📦 [PR image](https://quay.io/trustyai/regex-detector-ci?tab=tags): `quay.io/trustyai/regex-detector-ci:${{ github.event.pull_request.head.sha }}`
107
118
- name : Trivy scan
108
119
uses :
aquasecurity/[email protected]
109
120
with :
@@ -115,8 +126,22 @@ jobs:
115
126
exit-code : ' 0'
116
127
ignore-unfixed : false
117
128
vuln-type : ' os,library'
118
-
129
+ - name : Trivy scan, built-in image
130
+ uses :
aquasecurity/[email protected]
131
+ with :
132
+ scan-type : ' image'
133
+ image-ref : " ${{ env.BUILTIN_IMAGE_NAME }}:${{ env.TAG }}"
134
+ format : ' sarif'
135
+ output : ' trivy-results-built-in.sarif'
136
+ severity : ' MEDIUM,HIGH,CRITICAL'
137
+ exit-code : ' 0'
138
+ ignore-unfixed : false
139
+ vuln-type : ' os,library'
119
140
- name : Update Security tab
120
141
uses : github/codeql-action/upload-sarif@v3
121
142
with :
122
143
sarif_file : ' trivy-results.sarif'
144
+ - name : Update Security tab
145
+ uses : github/codeql-action/upload-sarif@v3
146
+ with :
147
+ sarif_file : ' trivy-results-built-in.sarif'
0 commit comments