File tree Expand file tree Collapse file tree 4 files changed +48
-18
lines changed
Expand file tree Collapse file tree 4 files changed +48
-18
lines changed Original file line number Diff line number Diff line change 1212
1313env :
1414 IMAGE_NAME : samanthamorris684/catbot
15- # Change this from latest
16- COMPARE_TAG : latest
1715 USERNAME : ${{ vars.DOCKERHUB_USERNAME }}
1816 PASSWORD : ${{ secrets.DOCKERHUB_TOKEN }}
1917
3432 run : |
3533 docker build -t $IMAGE_NAME:${{ inputs.IMAGE_TAG }} .
3634 docker push $IMAGE_NAME:${{ inputs.IMAGE_TAG }}
37-
38- - name : Docker Scout
39- id : docker-scout
40- if : ${{ github.event_name == 'pull_request' }}
41- uses : docker/scout-action@v1
42- with :
43- command : compare
44- image : $IMAGE_NAME:${{ inputs.IMAGE_TAG }}
45- to : ${{ env.IMAGE_NAME }}:${{ env.COMPARE_TAG }}
46- ignore-unchanged : true
47- only-severities : critical,high
48- write-comment : true
49- github-token : ${{ secrets.GITHUB_TOKEN }} # to be able to write the comment
5035
5136
5237
Original file line number Diff line number Diff line change 1010 with :
1111 IMAGE_TAG : $GITHUB_REF_NAME
1212 secrets :
13- DOCKERHUB_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
14-
15-
13+ DOCKERHUB_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ name : Pull request workflow
2+
3+ on :
4+ pull_request
5+
6+ jobs :
7+ scout :
8+ uses : ./.github/workflows/scout.yml
9+ with :
10+ IMAGE_TAG : $GITHUB_REF_NAME
Original file line number Diff line number Diff line change 1+ name : Security workflow
2+ on :
3+ workflow_call :
4+ inputs :
5+ IMAGE_TAG :
6+ required : true
7+ type : string
8+
9+ env :
10+ REGISTRY : samanthamorris684
11+ IMAGE_NAME : catbot
12+ COMPARE_TAG : latest
13+ USERNAME : ${{ vars.DOCKERHUB_USERNAME }}
14+ PASSWORD : ${{ secrets.DOCKERHUB_TOKEN }}
15+
16+ jobs :
17+ scout :
18+ runs-on : ubuntu-latest
19+ steps :
20+ - name : Login to registry
21+ uses : docker/login-action@v2.1.0
22+ with :
23+ registry : ${{ env.REGISTRY }}
24+ username : ${{ env.USERNAME }}
25+ password : ${{ env.PASSWORD }}
26+
27+ - name : Docker Scout
28+ id : docker-scout
29+ uses : docker/scout-action@v1
30+ with :
31+ command : compare
32+ image : $IMAGE_NAME:${{ inputs.IMAGE_TAG }}
33+ to : ${{ env.IMAGE_NAME }}:${{ env.COMPARE_TAG }}
34+ ignore-unchanged : true
35+ only-severities : critical,high
36+ write-comment : true
37+ github-token : ${{ secrets.GITHUB_TOKEN }} # to be able to write the comment
You can’t perform that action at this time.
0 commit comments