fix: support WARP_API_KEY env var as fallback for warp_api_key input#37
Closed
captainsafia wants to merge 1 commit into
Closed
fix: support WARP_API_KEY env var as fallback for warp_api_key input#37captainsafia wants to merge 1 commit into
captainsafia wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The e2e test was failing for dependabot PRs with:
This happened because GitHub Actions does not make repository secrets available to
pull_requestworkflows triggered bydependabot[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 fromprocess.env.WARP_API_KEYas a fallback when thewarp_api_keyinput is empty. BothrunAgentandreportShutdownuse the same fallback.action.yml: Updated thewarp_api_keydescription to document theWARP_API_KEYenvironment variable alternative..github/workflows/test_e2e.yml:WARP_API_KEYas a job-level environment variable (so the action picks it up automatically without an explicit input on each step).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.