Skip to content

Commit

Permalink
Require secrets to be set to run Pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
sealer3 committed Apr 25, 2024
1 parent 9494667 commit 062be1d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/pages-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,24 @@ on:
required: true

jobs:
check-secrets:
runs-on: ubuntu-latest
outputs:
has-secrets: ${{ steps.has-secrets.outputs.defined }}
steps:
- name: Check if deployment secrets are available
id: has-secrets
shell: bash
run: |
if [ "${{ secrets.apiToken }}" != '' ] && [ "${{ secrets.accountId }}" != '' ] && [ "${{ secrets.projectName }}" != '' ]; then
echo "defined=true" >> $GITHUB_OUTPUT;
else
echo "defined=false" >> $GITHUB_OUTPUT;
fi
deploy-cloudflare:
runs-on: ubuntu-latest
if: ${{ needs.check-secrets.outputs.has-secrets == 'true' }}
needs: [check-secrets]
permissions:
contents: read
deployments: write
Expand Down

0 comments on commit 062be1d

Please sign in to comment.