From 008389f8865eabb143be1855de2eeba5fec31cd2 Mon Sep 17 00:00:00 2001 From: sealer3 <125761775+sealer3@users.noreply.github.com> Date: Thu, 25 Apr 2024 02:57:35 +0100 Subject: [PATCH] Require secrets to be set to run Pages deployment --- .github/workflows/integration-deployment.yaml | 14 ++++++++++++++ .github/workflows/pages-deployment.yaml | 1 + 2 files changed, 15 insertions(+) diff --git a/.github/workflows/integration-deployment.yaml b/.github/workflows/integration-deployment.yaml index 6e750e4e5..5de524991 100644 --- a/.github/workflows/integration-deployment.yaml +++ b/.github/workflows/integration-deployment.yaml @@ -1,7 +1,15 @@ on: [push] jobs: + check-secrets: + if: github.repository == 'otterscan/otterscan' + runs-on: ubuntu-latest + steps: + - name: Check if repository name supports this workflow + - run: echo deploy-mainnet: uses: ./.github/workflows/pages-deployment.yaml + if: github.repository == 'otterscan/otterscan' + needs: [check-secrets] secrets: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} @@ -9,6 +17,8 @@ jobs: viteConfigJson: ${{ secrets.CLOUDFLARE_INTEG_MAINNET_SETTINGS }} deploy-gnosis: uses: ./.github/workflows/pages-deployment.yaml + if: github.repository == 'otterscan/otterscan' + needs: [check-secrets] secrets: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} @@ -16,6 +26,8 @@ jobs: viteConfigJson: ${{ secrets.CLOUDFLARE_INTEG_GNOSIS_SETTINGS }} deploy-op-mainnet: uses: ./.github/workflows/pages-deployment.yaml + if: github.repository == 'otterscan/otterscan' + needs: [check-secrets] secrets: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} @@ -23,6 +35,8 @@ jobs: viteConfigJson: ${{ secrets.CLOUDFLARE_INTEG_OP_MAINNET_SETTINGS }} deploy-e3-sepolia: uses: ./.github/workflows/pages-deployment.yaml + if: github.repository == 'otterscan/otterscan' + needs: [check-secrets] secrets: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} diff --git a/.github/workflows/pages-deployment.yaml b/.github/workflows/pages-deployment.yaml index 441d995a2..82cbbd0df 100644 --- a/.github/workflows/pages-deployment.yaml +++ b/.github/workflows/pages-deployment.yaml @@ -16,6 +16,7 @@ jobs: permissions: contents: read deployments: write + if: github.repository == 'otterscan/otterscan' steps: - name: Checkout uses: actions/checkout@v4