From 9133027ea4add0bd9cd2228c7fc04240847b26af Mon Sep 17 00:00:00 2001 From: pascalholthaus <94793111+pascalholthaus@users.noreply.github.com> Date: Tue, 3 Dec 2024 09:59:02 +0100 Subject: [PATCH] Change: Check secret in bash --- .github/workflows/container-build-push-2nd-gen.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/container-build-push-2nd-gen.yml b/.github/workflows/container-build-push-2nd-gen.yml index ab74338..7daaa2f 100644 --- a/.github/workflows/container-build-push-2nd-gen.yml +++ b/.github/workflows/container-build-push-2nd-gen.yml @@ -258,13 +258,17 @@ jobs: registry-password: ${{ secrets.GREENBONE_REGISTRY_TOKEN }} harbor-replication: - if: github.event_name != 'pull_request' && secrets.GREENBONE_REGISTRY_REPLICATION_TOKEN + if: github.event_name != 'pull_request' needs: create-multi-arch-manifest runs-on: self-hosted-generic steps: - name: Trigger harbor replication shell: bash run: | + if ! [ '${{ secrets.GREENBONE_REGISTRY_REPLICATION_TOKEN }}' ]; then + echo "Secret GREENBONE_REGISTRY_REPLICATION_TOKEN does not exist" + exit 0 + fi curl -X POST \ https://${{ vars.GREENBONE_REGISTRY }}/api/v2.0/replication/executions \ -u '${{ secrets.GREENBONE_REGISTRY_REPLICATION_USER }}:${{ secrets.GREENBONE_REGISTRY_REPLICATION_TOKEN }}' \