Skip to content

fix: support WARP_API_KEY env var as fallback for warp_api_key input#37

Closed
captainsafia wants to merge 1 commit into
mainfrom
oz-agent/fix-warp-api-key-env-var
Closed

fix: support WARP_API_KEY env var as fallback for warp_api_key input#37
captainsafia wants to merge 1 commit into
mainfrom
oz-agent/fix-warp-api-key-env-var

Conversation

@captainsafia

Copy link
Copy Markdown
Collaborator

Problem

The e2e test was failing for dependabot PRs with:

##[error]`warp_api_key` must be provided.

This happened because GitHub Actions does not make repository secrets available to pull_request workflows triggered by dependabot[bot], so ${{ secrets.WARP_API_KEY }} resolved to an empty string.

More broadly, the action only supported providing the API key as an explicit action input (warp_api_key:), which is less flexible than the common GitHub Actions pattern of passing credentials as environment variables.

Changes

src/index.ts: The action now reads the Warp API key from process.env.WARP_API_KEY as a fallback when the warp_api_key input is empty. Both runAgent and reportShutdown use the same fallback.

action.yml: Updated the warp_api_key description to document the WARP_API_KEY environment variable alternative.

.github/workflows/test_e2e.yml:

  • Exposes WARP_API_KEY as a job-level environment variable (so the action picks it up automatically without an explicit input on each step).
  • Skips the job for dependabot[bot] PRs, which cannot access repository secrets and would fail unconditionally regardless.

src/index.test.ts: Added two new unit tests covering the env var fallback path.


Conversation: https://staging.warp.dev/conversation/88a39534-8cc9-4164-9e9d-b0daa39f6200
Run: https://oz.staging.warp.dev/runs/019f400c-1ff7-7cc1-9f19-354fa77c74c1
This PR was generated with Oz.

The action now reads the Warp API key from the WARP_API_KEY environment
variable when the warp_api_key input is not provided. This allows callers
to pass the key as a job-level environment variable rather than an action
input, which is a common pattern for API keys in GitHub Actions.

The e2e test workflow is updated to:
- Expose WARP_API_KEY as a job-level env var (so the action picks it up
  automatically without an explicit input)
- Skip for dependabot[bot] PRs, which don't have access to repository
  secrets and would fail unconditionally

Co-Authored-By: Oz <oz-agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant