From 9b37708f0cf44f610b73ef355802520da57ebd69 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 28 Sep 2025 00:21:05 +0300 Subject: [PATCH] fix(ci): missing deployment secrets in reusable action --- .../deploy-to-cloudflare-pages/action.yml | 19 ++++++++++++++----- .github/workflows/deploy-docs.yml | 3 +++ .github/workflows/website.yml | 3 +++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/actions/deploy-to-cloudflare-pages/action.yml b/.github/actions/deploy-to-cloudflare-pages/action.yml index c449af272..4f7a4a177 100644 --- a/.github/actions/deploy-to-cloudflare-pages/action.yml +++ b/.github/actions/deploy-to-cloudflare-pages/action.yml @@ -13,6 +13,15 @@ inputs: deploy_dir: description: "The directory from which to deploy." required: true + cloudflare_api_token: + description: "The Cloudflare API token to use for deployment." + required: true + cloudflare_account_id: + description: "The Cloudflare account ID to use for deployment." + required: true + github_token: + description: "The GitHub token to use for posting PR comments." + required: true runs: using: composite steps: @@ -27,8 +36,8 @@ runs: if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' uses: cloudflare/wrangler-action@v3 with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + apiToken: ${{ inputs.cloudflare_api_token }} + accountId: ${{ inputs.cloudflare_account_id }} command: pages deploy ${{ inputs.deploy_dir }} --project-name=${{ inputs.project_name}} --branch=${{ github.ref_name }} wranglerVersion: '' # Use pre-installed version @@ -38,8 +47,8 @@ runs: if: github.event_name == 'pull_request' uses: cloudflare/wrangler-action@v3 with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + apiToken: ${{ inputs.cloudflare_api_token }} + accountId: ${{ inputs.cloudflare_account_id }} command: pages deploy ${{ inputs.deploy_dir }} --project-name=${{ inputs.project_name}} --branch=pr-${{ github.event.pull_request.number }} wranglerVersion: '' # Use pre-installed version @@ -52,7 +61,7 @@ runs: PRODUCTION_URL: ${{ inputs.production_url }} PROJECT_NAME: ${{ inputs.project_name }} with: - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ inputs.github_token }} script: | const prNumber = context.issue.number; // Construct preview URL based on Cloudflare Pages pattern diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index e0c91ac40..6abd9af47 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -123,3 +123,6 @@ jobs: comment_body: "📚 Documentation preview is ready" production_url: "https://docs.triliumnotes.org" deploy_dir: "site" + cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }} + cloudflare_account_id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 8cd58460d..83b96cc0e 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -38,3 +38,6 @@ jobs: comment_body: "📚 Website preview is ready" production_url: "https://triliumnotes.org" deploy_dir: "apps/website/dist" + cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }} + cloudflare_account_id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + github_token: ${{ secrets.GITHUB_TOKEN }}