## Description The reusable workflows under [`warpdotdev/oz-for-oss`](https://github.com/warpdotdev/oz-for-oss/tree/main/.github/workflows) declare their Warp API key secret as `OSS_WARP_API_KEY`, but the local caller workflows in this repo were forwarding it as `WARP_API_KEY`. Because the name being passed didn't match the name declared by `workflow_call`, the required secret was effectively missing and an undeclared secret was being passed instead, which caused `startup_failure` on every invocation. Example failure: https://github.com/warpdotdev/warp/actions/runs/25058665906 (Triage New Issues (Local), `startup_failure`). This PR renames the forwarded secret to `OSS_WARP_API_KEY:` in all local adapter workflows so the names match what the reusable workflows declare. The underlying secret value is still pulled from `secrets.OSS_WARP_API_KEY` in this repo, so no repo secret changes are needed. Affected workflows: - `.github/workflows/create-implementation-from-issue-local.yml` - `.github/workflows/create-spec-from-issue-local.yml` - `.github/workflows/enforce-pr-issue-state.yml` - `.github/workflows/respond-to-pr-comment-local.yml` - `.github/workflows/respond-to-triaged-issue-comment-local.yml` - `.github/workflows/review-pull-request.yml` - `.github/workflows/triage-new-issues-local.yml` - `.github/workflows/trigger-implementation-on-plan-approved-local.yml` - `.github/workflows/update-dedupe-local.yml` - `.github/workflows/update-pr-review-local.yml` - `.github/workflows/update-triage-local.yml` - `.github/workflows/verify-pr-comment-local.yml` ## Testing Manual review of the rename. After merge, re-run the failing `Triage New Issues (Local)` workflow to confirm it no longer hits `startup_failure` due to a missing required secret. ## Server API dependencies N/A — CI workflow change only. ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode _Conversation: https://staging.warp.dev/conversation/fbace74a-9da2-445f-8486-e5a5907dce57_ _Run: https://oz.staging.warp.dev/runs/019dd47c-42e0-7072-8206-e6be4df5cde7_ _This PR was generated with [Oz](https://warp.dev/oz)._ Co-authored-by: Oz Agent <oz-agent@warp.dev>
142 lines
5.7 KiB
YAML
142 lines
5.7 KiB
YAML
name: Review Pull Request
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
pr_number:
|
|
description: Pull request number to review
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
trigger_source:
|
|
description: Source that requested the review
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
requester:
|
|
description: Login of the user who requested the review, if any
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
focus:
|
|
description: Optional extra focus guidance for the review
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
comment_id:
|
|
description: Issue comment ID to react to for slash-command reviews
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
secrets:
|
|
OZ_MGMT_GHA_APP_ID:
|
|
required: true
|
|
OZ_MGMT_GHA_PRIVATE_KEY:
|
|
required: true
|
|
OSS_WARP_API_KEY:
|
|
required: true
|
|
pull_request_target:
|
|
types:
|
|
- opened
|
|
- ready_for_review
|
|
- review_requested
|
|
- labeled
|
|
jobs:
|
|
resolve:
|
|
runs-on: ubuntu-slim
|
|
permissions:
|
|
contents: read
|
|
outputs:
|
|
should_run: ${{ steps.resolve.outputs.should_run }}
|
|
pr_number: ${{ steps.resolve.outputs.pr_number }}
|
|
trigger_source: ${{ steps.resolve.outputs.trigger_source }}
|
|
requester: ${{ steps.resolve.outputs.requester }}
|
|
focus: ${{ steps.resolve.outputs.focus }}
|
|
comment_id: ${{ steps.resolve.outputs.comment_id }}
|
|
skip_reason: ${{ steps.resolve.outputs.skip_reason }}
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
- name: Resolve review context
|
|
id: resolve
|
|
env:
|
|
INPUT_PR_NUMBER: ${{ inputs.pr_number || '' }}
|
|
INPUT_TRIGGER_SOURCE: ${{ inputs.trigger_source || '' }}
|
|
INPUT_REQUESTER: ${{ inputs.requester || '' }}
|
|
INPUT_FOCUS: ${{ inputs.focus || '' }}
|
|
INPUT_COMMENT_ID: ${{ inputs.comment_id || '' }}
|
|
GITHUB_ACTOR_LOGIN: ${{ github.actor }}
|
|
run: |
|
|
python - <<'PY'
|
|
import json
|
|
import os
|
|
from pathlib import Path
|
|
event = json.loads(Path(os.environ["GITHUB_EVENT_PATH"]).read_text())
|
|
event_name = os.environ.get("GITHUB_EVENT_NAME", "")
|
|
input_pr_number = os.environ.get("INPUT_PR_NUMBER", "").strip()
|
|
pr = event.get("pull_request") or {}
|
|
head_ref = ((pr.get("head") or {}).get("ref") or "").strip()
|
|
action = (event.get("action") or "").strip()
|
|
requested_reviewer = ((event.get("requested_reviewer") or {}).get("login") or "").strip()
|
|
label_name = ((event.get("label") or {}).get("name") or "").strip()
|
|
has_pr_hooks = Path(".github/workflows/pr-hooks.yml").exists()
|
|
trigger_source = os.environ.get("INPUT_TRIGGER_SOURCE", "").strip() or event_name
|
|
requester = os.environ.get("INPUT_REQUESTER", "").strip() or os.environ.get("GITHUB_ACTOR_LOGIN", "")
|
|
focus = os.environ.get("INPUT_FOCUS", "")
|
|
comment_id = os.environ.get("INPUT_COMMENT_ID", "")
|
|
pr_number = input_pr_number or str(pr.get("number") or "")
|
|
matches_direct_trigger = (
|
|
(action == "opened" and not pr.get("draft", False))
|
|
or action == "ready_for_review"
|
|
or (action == "review_requested" and requested_reviewer == "oz-agent")
|
|
or (action == "labeled" and label_name == "oz-review")
|
|
)
|
|
if input_pr_number:
|
|
should_run = True
|
|
elif head_ref.startswith("cherrypick"):
|
|
should_run = False
|
|
elif has_pr_hooks and event_name == "pull_request_target":
|
|
should_run = False
|
|
else:
|
|
should_run = matches_direct_trigger and bool(pr_number)
|
|
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as fh:
|
|
fh.write(f"should_run={'true' if should_run else 'false'}\n")
|
|
fh.write(f"pr_number={pr_number}\n")
|
|
fh.write(f"trigger_source={trigger_source}\n")
|
|
fh.write(f"requester={requester}\n")
|
|
fh.write("focus<<__EOF__\n")
|
|
fh.write(focus)
|
|
fh.write("\n__EOF__\n")
|
|
fh.write(f"comment_id={comment_id}\n")
|
|
if has_pr_hooks and event_name == "pull_request_target" and not input_pr_number:
|
|
fh.write("skip_reason=pr-hooks-present\n")
|
|
elif head_ref.startswith("cherrypick"):
|
|
fh.write("skip_reason=cherrypick-branch\n")
|
|
elif not should_run:
|
|
fh.write("skip_reason=event-not-enabled\n")
|
|
PY
|
|
skip_direct_trigger:
|
|
needs: resolve
|
|
if: needs.resolve.outputs.should_run != 'true' && needs.resolve.outputs.skip_reason == 'pr-hooks-present'
|
|
runs-on: ubuntu-slim
|
|
steps:
|
|
- name: Explain skip
|
|
run: echo "PR review orchestration skipped because .github/workflows/pr-hooks.yml is present."
|
|
review_pr:
|
|
needs: resolve
|
|
if: needs.resolve.outputs.should_run == 'true'
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
issues: write
|
|
uses: warpdotdev/oz-for-oss/.github/workflows/review-pull-request.yml@main
|
|
with:
|
|
pr_number: ${{ needs.resolve.outputs.pr_number }}
|
|
trigger_source: ${{ needs.resolve.outputs.trigger_source }}
|
|
requester: ${{ needs.resolve.outputs.requester }}
|
|
focus: ${{ needs.resolve.outputs.focus }}
|
|
comment_id: ${{ needs.resolve.outputs.comment_id }}
|
|
secrets:
|
|
OZ_MGMT_GHA_APP_ID: ${{ secrets.OZ_MGMT_GHA_APP_ID }}
|
|
OZ_MGMT_GHA_PRIVATE_KEY: ${{ secrets.OZ_MGMT_GHA_PRIVATE_KEY }}
|
|
OSS_WARP_API_KEY: ${{ secrets.OSS_WARP_API_KEY }}
|