From dbb9ddfe4983ddb9aa72fa85452d85e96e501b91 Mon Sep 17 00:00:00 2001 From: Kim Gustyr Date: Wed, 16 Oct 2024 17:37:28 +0100 Subject: [PATCH] fix(ci): Failing Trivy cron job (#4741) --- .github/workflows/platform-docker-trivy-scan.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform-docker-trivy-scan.yml b/.github/workflows/platform-docker-trivy-scan.yml index 47fbb5cafb9e..9c3ac1391eb6 100644 --- a/.github/workflows/platform-docker-trivy-scan.yml +++ b/.github/workflows/platform-docker-trivy-scan.yml @@ -33,6 +33,7 @@ on: # Inputs don't work for cron runs, define defaults as env env: + REGISTRY_URL: ${{ inputs.registry-url || 'ghcr.io' }} TRIVY_DB_REPOSITORY_SOURCE: ${{ github.event.inputs.trivy-db-repository-source || 'ghcr.io/aquasecurity/trivy-db:latest' }} TRIVY_JAVA_DB_REPOSITORY_SOURCE: @@ -58,7 +59,7 @@ jobs: with: shell: bash command: | - oras login -u ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} ${{ inputs.registry-url }} + oras login -u ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} ${{ env.REGISTRY_URL }} oras pull --no-tty $TRIVY_DB_REPOSITORY_SOURCE oras pull --no-tty $TRIVY_JAVA_DB_REPOSITORY_SOURCE oras push $TRIVY_DB_REPOSITORY db.tar.gz:$MIME_TYPE+gzip --artifact-type $MIME_TYPE+json @@ -102,7 +103,7 @@ jobs: id: trivy uses: ./.github/actions/trivy-scan-image with: - image-tag: ${{ inputs.registry-url }}/flagsmith/${{ matrix.image-name }}:main + image-tag: ${{ env.REGISTRY_URL }}/flagsmith/${{ matrix.image-name }}:main category: ${{ matrix.image-name }} query: branch:main trivy-username: ${{ github.actor }}