File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,12 @@ name: Build and push agentless container image
22
33# Configures this workflow to run every time a tag is created
44on :
5+ pull_request :
6+ branches :
7+ - main
8+ paths :
9+ - containers/agentless/**
10+ - .github/workflows/agentless-container.yaml
511 push :
612 branches :
713 - main
5763 done
5864 TAGS=$(echo $TAGS | tr '[:upper:]' '[:lower:]')
5965
60- docker buildx build --push --platform linux/amd64,linux/arm64 $TAGS --metadata-file=metadata.json -f ../containers/agentless/Dockerfile ../containers/agentless
66+ # GITHUB_BASE_REF is only set when the action source event is a pull request.
67+ # in that case don't push.
68+ export PUSH=$(if [ -z ${GITHUB_BASE_REF+x} ]; then echo "--push"; else echo ""; fi)
69+ docker buildx build $PUSH --platform linux/amd64,linux/arm64 $TAGS --metadata-file=metadata.json -f ../containers/agentless/Dockerfile ../containers/agentless
6170
6271 cat metadata.json
6372 echo "digest=$(cat metadata.json | jq -r .\"containerimage.digest\")" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments