Skip to content

Commit 9743034

Browse files
committed
fix: add DOCKER_PUSH_BOOL input to Docker workflow for conditional image pushing
1 parent 7f5177c commit 9743034

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/docker-build-and-scan.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
required: false
1717
type: boolean
1818
default: false
19+
DOCKER_PUSH_BOOL:
20+
required: false
21+
type: boolean
22+
default: false
1923

2024
jobs:
2125
build-and-scan:
@@ -38,7 +42,7 @@ jobs:
3842
context: ${{ inputs.DOCKER_PATH_CONTEXT }}
3943
file: ${{ inputs.DOCKER_BUILD_DOCKERFILE}}
4044
load: ${{ inputs.DOCKER_LOAD_BOOL }}
41-
push: ${{ github.event_name == 'workflow_call' }}
45+
push: ${{ inputs.DOCKER_PUSH_BOOL }}
4246
tags: ${{ inputs.DOCKER_TAGS }}
4347
- name: Run Trivy vulnerability scanner (remote)
4448
uses: aquasecurity/trivy-action@0.33.1

.github/workflows/run-branch-scan.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ on:
66
- main
77
jobs:
88
docker-build-and-scan:
9-
uses: milsman2/python-app-template/.github/workflows/docker-build-and-scan.yaml@main
9+
uses: ./.github/workflows/docker-build-and-scan.yaml
1010
secrets: inherit
1111
with:
1212
DOCKER_PATH_CONTEXT: .
1313
DOCKER_BUILD_DOCKERFILE: Dockerfile
1414
DOCKER_LOAD_BOOL: true
1515
DOCKER_TAGS: sample-python-app:${{ github.sha }}
16+
DOCKER_PUSH_BOOL: false

0 commit comments

Comments
 (0)