Skip to content

Commit

Permalink
ci: read cloudflare credentials from action input
Browse files Browse the repository at this point in the history
  • Loading branch information
rndquu committed Mar 12, 2024
1 parent 06783ab commit f893c79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .github/cloudflare-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ echo "Checking if project exists..."

# Specifically scoped for public contributors to automatically deploy to our team Cloudflare account

CLOUDFLARE_ACCOUNT_ID="17b9dfa79e16b79dffcb11a66768539c"

# 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" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
Expand Down
9 changes: 8 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ inputs:
pull_request_number:
description: "Pull request number for posting the deployment link"
required: true
cloudflare_account_id:
description: "Cloudflare account id"
required: true
cloudflare_api_token:
description: "Cloudflare API token"
required: true
commit_sha:
description: "Commit SHA for posting the deployment link"
required: false
Expand All @@ -39,7 +45,8 @@ runs:
run: bash ../../_actions/ubiquity/cloudflare-deploy-action/main/.github/cloudflare-deploy.sh "${{ inputs.repository }}" "${{ inputs.production_branch }}" "${{ inputs.output_directory }}" "${{ inputs.current_branch }}"
shell: bash
env:
CLOUDFLARE_API_TOKEN: "JWo5dPsoyohH5PRu89-RktjCvRN0-ODC6CC9ZBqF"
CLOUDFLARE_ACCOUNT_ID: ${{ inputs.cloudflare_account_id }}
CLOUDFLARE_API_TOKEN: ${{ inputs.cloudflare_api_token }}

- name: Post Deployment on Pull Request or Commit
shell: bash
Expand Down

0 comments on commit f893c79

Please sign in to comment.