41
41
- name : Set up Docker Buildx
42
42
uses : docker/setup-buildx-action@v2
43
43
- name : Login to DockerHub container registry
44
- if : ${{ inputs.login_dockerhub }}
44
+ if : inputs.login_dockerhub
45
45
uses : docker/login-action@v2
46
46
with :
47
47
username : ${{ secrets.DOCKERHUB_USERNAME }}
@@ -50,30 +50,22 @@ jobs:
50
50
run : |
51
51
docker pull aquasec/trivy:${{ inputs.trivy_tag }}
52
52
- name : Download container image from artifacts if uploaded
53
- if : ${{ inputs.image_artifact_name }} != null &&
54
- ${{ inputs.image_artifact_filename }} != null
55
- uses : actions/download-artifact@v2
53
+ if : inputs.image_artifact_name != '' &&
54
+ inputs.image_artifact_filename != ''
55
+ uses : actions/download-artifact@v3.0.2
56
56
with :
57
57
name : ${{ inputs.image_artifact_name }}
58
58
path : /tmp
59
59
- name : Load container image file if one is shipped via artifacts
60
- if : ${{ inputs.image_artifact_name }} != null &&
61
- ${{ inputs.image_artifact_filename }} != null
60
+ if : inputs.image_artifact_name != '' &&
61
+ inputs.image_artifact_filename != ''
62
62
run : |
63
63
docker load --input /tmp/${{ inputs.image_artifact_filename }}
64
- RC=$?
65
- if [ ${RC} -gt 0 ]; then
66
- exit ${RC}
67
- fi
68
64
- name : Pull container image that should be scanned if no container image is shipped via artifacts
69
- if : ${{ inputs.image_artifact_name }} == null &&
70
- ${{ inputs.image_artifact_filename }} == null
65
+ if : inputs.image_artifact_name == '' ||
66
+ inputs.image_artifact_filename == ''
71
67
run : |
72
68
docker pull ${{ inputs.image_name }}
73
- RC=$?
74
- if [ ${RC} -gt 0 ]; then
75
- exit ${RC}
76
- fi
77
69
- name : List available container images in local repository
78
70
run : |
79
71
docker image ls -a
0 commit comments