Skip to content

Commit

Permalink
refactor: check that project exists
Browse files Browse the repository at this point in the history
  • Loading branch information
rndquu authored Oct 9, 2024
1 parent 7f547b7 commit 42ad733
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/cloudflare-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ echo "Checking if project exists..."
# Specifically scoped for public contributors to automatically deploy to our team Cloudflare account

# Fetch the list of projects and check if the specific project exists
project_exists=$(curl -s -X GET "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/pages/projects" \
project_exists=$(curl -s -X GET "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/pages/projects/$REPOSITORY_NAME" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" | jq -r ".result[] | select(.name == \"$REPOSITORY_NAME\") | .name")
-H "Content-Type: application/json" | jq -r ".result.name")

if [ "$project_exists" == "$REPOSITORY_NAME" ]; then
echo "Project already exists. Skipping creation..."
Expand Down

0 comments on commit 42ad733

Please sign in to comment.