1+ permissions : {}
2+
13on :
24 workflow_call :
35 inputs :
@@ -27,10 +29,12 @@ jobs:
2729
2830 steps :
2931 - name : Checkout Repository
30- uses : actions/checkout@v6.0.2
32+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
33+ with :
34+ persist-credentials : false
3135
3236 - name : Set up NodeJs
33- uses : actions/setup-node@v6.3.0
37+ uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # tag= v6.3.0
3438 with :
3539 node-version : ' 20'
3640 cache : ' npm'
4347 npm run build --if-present
4448
4549 - name : Upload Artifacts
46- uses : actions/upload-artifact@v7.0.0
50+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # tag= v7.0.0
4751 with :
4852 name : assembled-frontend
4953 path : |-
@@ -57,24 +61,26 @@ jobs:
5761
5862 steps :
5963 - name : Checkout Repository
60- uses : actions/checkout@v6.0.2
64+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
65+ with :
66+ persist-credentials : false
6167
6268 - name : Download Artifacts
63- uses : actions/download-artifact@v8.0.0
69+ uses : actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # tag= v8.0.0
6470 with :
6571 name : assembled-frontend
6672
6773 - name : Set up QEMU
68- uses : docker/setup-qemu-action@v4.0 .0
74+ uses : docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # tag=v3.7 .0
6975
7076 - name : Set up Docker Buildx
71- uses : docker/setup-buildx-action@v4.0.0
77+ uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # tag= v4.0.0
7278 id : buildx
7379 with :
7480 install : true
7581
7682 - name : Login to Docker.io
77- uses : docker/login-action@v4.0.0
83+ uses : docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # tag= v4.0.0
7884 if : ${{ inputs.publish-container }}
7985 with :
8086 registry : docker.io
@@ -83,23 +89,25 @@ jobs:
8389
8490 - name : Set Container Tags
8591 id : tags
92+ env :
93+ REF_NAME : ${{ inputs.ref-name }}
94+ APP_VERSION : ${{ inputs.app-version }}
8695 run : |-
8796 IMAGE_NAME="docker.io/dependencytrack/frontend"
88- REF_NAME="${{ inputs.ref-name }}"
8997 TAGS=""
9098
9199 if [[ $REF_NAME == feature-* ]]; then
92100 TAGS="${IMAGE_NAME}:${REF_NAME,,}"
93101 else
94- TAGS="${IMAGE_NAME}:${{ inputs.app-version } }"
95- if [[ "${{ inputs.app-version } }" != "snapshot" ]]; then
102+ TAGS="${IMAGE_NAME}:${APP_VERSION }"
103+ if [[ "${APP_VERSION }" != "snapshot" ]]; then
96104 TAGS="${TAGS},${IMAGE_NAME}:latest"
97105 fi
98106 fi
99107 echo "tags=${TAGS}" >> $GITHUB_OUTPUT
100108
101109 - name : Build multi-arch Container Image
102- uses : docker/build-push-action@v7.0.0
110+ uses : docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # tag= v7.0.0
103111 with :
104112 tags : ${{ steps.tags.outputs.tags }}
105113 build-args : |-
@@ -109,23 +117,3 @@ jobs:
109117 push : ${{ inputs.publish-container }}
110118 context : .
111119 file : docker/Dockerfile.alpine
112-
113- - name : Run Trivy Vulnerability Scanner
114- if : ${{ inputs.publish-container }}
115- uses : aquasecurity/trivy-action@0.34.2
116- env :
117- # https://github.com/aquasecurity/trivy-action/issues/389
118- TRIVY_DB_REPOSITORY : ' public.ecr.aws/aquasecurity/trivy-db:2'
119- TRIVY_JAVA_DB_REPOSITORY : ' public.ecr.aws/aquasecurity/trivy-java-db:1'
120- with :
121- image-ref : docker.io/dependencytrack/frontend:${{ inputs.app-version }}
122- format : ' sarif'
123- output : ' trivy-results.sarif'
124- ignore-unfixed : true
125- vuln-type : ' os'
126-
127- - name : Upload Trivy Scan Results to GitHub Security Tab
128- if : ${{ inputs.publish-container }}
129- uses : github/codeql-action/upload-sarif@v4
130- with :
131- sarif_file : ' trivy-results.sarif'
0 commit comments