Skip to content

Cloudflare requires either API Token or email/global key #62

@andrew-welch

Description

@andrew-welch

Describe the bug
Currently the API Token and Global Key share the same variable, so there is a chance that a user will add an API Token and Email, which triggers the Global Key authentication method and fails.

To Reproduce
Steps to reproduce the behavior:

  1. Set up a repo in GitHub, and API Token in Cloudflare
  2. Add ACCOUNT_EMAIL, API_TOKEN, and ACCOUNT_ID secrets.
  3. Attempt to run workflow.
  4. Error: "Error fetching deployments"

Expected behavior
Login can happen with either the API Key or the Email/Global Key, whether email is set or not.
Global Key should use a different variable name.

Additional context
This issue is caused when ACCOUNT_EMAIL, API_TOKEN, and ACCOUNT_ID are all set up. The presence of ACCOUNT_EMAIL seems to trigger the Global API key authentication approach:

//cloudflare.js:23

const headers = accountEmail
    ? {
        'X-Auth-Key': token,
        'X-Auth-Email': accountEmail
      }
    : {
        Authorization: `Bearer ${token}`
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions