Skip to content

Commit ae6b657

Browse files
authored
fix(agentless): use the github built-ins for event type detection (#15)
1 parent fafe1d4 commit ae6b657

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/agentless-container.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ jobs:
6262
TAGS+="-t ${{ env.REGISTRY }}/${{env.IMAGE_NAME}}/agentless:$version "
6363
done
6464
TAGS=$(echo $TAGS | tr '[:upper:]' '[:lower:]')
65-
65+
echo "======== Tags: ========\n $TAGS"
6666
# GITHUB_BASE_REF is only set when the action source event is a pull request.
6767
# in that case don't push.
68-
export PUSH=$(if [ -z ${GITHUB_BASE_REF+x} ]; then echo "--push"; else echo ""; fi)
68+
export PUSH=$(if [ ${{ github.event_name }} != 'pull_request' ]; then echo "--push"; else echo ""; fi)
69+
6970
docker buildx build $PUSH --platform linux/amd64,linux/arm64 $TAGS --metadata-file=metadata.json -f ../containers/agentless/Dockerfile ../containers/agentless
7071
7172
cat metadata.json
@@ -75,7 +76,7 @@ jobs:
7576
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see [AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
7677
- name: Generate artifact attestation
7778
uses: actions/attest-build-provenance@v2
78-
if: ${{ env.GITHUB_BASE_REF != '' }}
79+
if: ${{ github.event_name != 'pull_request' }}
7980
with:
8081
subject-name: ${{ env.REGISTRY }}/${{env.IMAGE_NAME}}/agentless
8182
subject-digest: ${{ steps.build.outputs.digest }}

0 commit comments

Comments
 (0)