diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0be4ed81..dafc0965 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -397,14 +397,23 @@ jobs: - name: Install Kurtosis CDK tools uses: ./.github/actions/setup-kurtosis-cdk + # Step to handle when the SP1_PRIVATE_KEY secret is available - name: Replace Agglayer SP1 Prover Key with Github Secrets run: | sed -i "s/agglayer_prover_sp1_key: \"\"/agglayer_prover_sp1_key: \"${{ secrets.SP1_PRIVATE_KEY }}\"/" ./.github/tests/agglayer-sp1-key.yml # This step will only execute if the necessary secrets are available, preventing failures # on pull requests from forked repositories. - if: ${{ env.agglayer_prover_sp1_key }} + if: ${{ env.agglayer_prover_sp1_key && env.agglayer_prover_sp1_key != '' }} env : agglayer_prover_sp1_key: ${{ secrets.SP1_PRIVATE_KEY }} + + # Step to handle when the SP1_PRIVATE_KEY secret is not available + - name: Handle missing SP1_PRIVATE_KEY secret + if: ${{ !env.agglayer_prover_sp1_key || env.agglayer_prover_sp1_key == '' }} + run: | + sed -i '/agglayer_prover_sp1_key:/d' ./.github/tests/agglayer-sp1-key.yml + env: + agglayer_prover_sp1_key: ${{ secrets.SP1_PRIVATE_KEY }} - name: Deploy L1 chain and a first CDK L2 chain (cdk-erigon sequencer + cdk stack) run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/agglayer-sp1-key.yml .