Initial public release of Warp.
Repo-Sync-Origin: warpdotdev/warp-internal@12af1d983b
This commit is contained in:
@@ -0,0 +1,170 @@
|
||||
name: "Docubot"
|
||||
description: "Helps Warp engineers identify PRs that need documentation updates in GitBook"
|
||||
inputs:
|
||||
prompt:
|
||||
description: "Prompt to send to Warp"
|
||||
required: true
|
||||
warp_api_key:
|
||||
description: "Warp API key"
|
||||
required: true
|
||||
warp_channel:
|
||||
description: "Warp release channel (e.g., dev, preview, stable)"
|
||||
required: false
|
||||
default: "dev"
|
||||
profile_id:
|
||||
description: "Warp profile ID"
|
||||
required: false
|
||||
github_token:
|
||||
description: "GitHub token for cloning private repositories"
|
||||
required: false
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup Warp CLI
|
||||
uses: ./.github/actions/setup_warp_cli
|
||||
with:
|
||||
warp_channel: ${{ inputs.warp_channel }}
|
||||
- name: Clone Warp GitBook repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
repository: warpdotdev/gitbook
|
||||
token: ${{ inputs.github_token }}
|
||||
path: gitbook
|
||||
- name: Create prompt file
|
||||
shell: bash
|
||||
# TODO: use sdk (python or typescript) for this
|
||||
run: |
|
||||
set -euo pipefail
|
||||
envsubst < .github/actions/docubot/prompt.txt > prompt.output.txt
|
||||
env:
|
||||
# GitHub Repository Context
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
|
||||
GITHUB_REPOSITORY_OWNER_ID: ${{ github.repository_owner_id }}
|
||||
GITHUB_REPOSITORY_ID: ${{ github.repository_id }}
|
||||
GITHUB_REPOSITORY_URL: ${{ github.repositoryUrl }}
|
||||
|
||||
# GitHub Event Context
|
||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
||||
GITHUB_EVENT_PATH: ${{ github.event_path }}
|
||||
GITHUB_EVENT_ACTION: ${{ github.event.action }}
|
||||
|
||||
# GitHub Workflow Context
|
||||
GITHUB_WORKFLOW: ${{ github.workflow }}
|
||||
GITHUB_WORKFLOW_REF: ${{ github.workflow_ref }}
|
||||
GITHUB_WORKFLOW_SHA: ${{ github.workflow_sha }}
|
||||
GITHUB_JOB: ${{ github.job }}
|
||||
GITHUB_RUN_ID: ${{ github.run_id }}
|
||||
GITHUB_RUN_NUMBER: ${{ github.run_number }}
|
||||
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
|
||||
|
||||
# GitHub Actor Context
|
||||
GITHUB_ACTOR: ${{ github.actor }}
|
||||
GITHUB_ACTOR_ID: ${{ github.actor_id }}
|
||||
GITHUB_TRIGGERING_ACTOR: ${{ github.triggering_actor }}
|
||||
|
||||
# GitHub Git Context
|
||||
GITHUB_REF: ${{ github.ref }}
|
||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||
GITHUB_REF_PROTECTED: ${{ github.ref_protected }}
|
||||
GITHUB_REF_TYPE: ${{ github.ref_type }}
|
||||
GITHUB_SHA: ${{ github.sha }}
|
||||
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
||||
GITHUB_BASE_REF: ${{ github.base_ref }}
|
||||
|
||||
# Issue/PR Context
|
||||
PR_OR_ISSUE_TITLE: ${{ github.event.issue.title || github.event.pull_request.title }}
|
||||
PR_OR_ISSUE_BODY: ${{ github.event.issue.body || github.event.pull_request.body }}
|
||||
PR_OR_ISSUE_NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }}
|
||||
PR_OR_ISSUE_URL: ${{ github.event.issue.html_url || github.event.pull_request.html_url }}
|
||||
PR_OR_ISSUE_STATE: ${{ github.event.issue.state || github.event.pull_request.state }}
|
||||
PR_OR_ISSUE_CREATED_AT: ${{ github.event.issue.created_at || github.event.pull_request.created_at }}
|
||||
PR_OR_ISSUE_UPDATED_AT: ${{ github.event.issue.updated_at || github.event.pull_request.updated_at }}
|
||||
PR_OR_ISSUE_USER_LOGIN: ${{ github.event.issue.user.login || github.event.pull_request.user.login }}
|
||||
PR_OR_ISSUE_USER_ID: ${{ github.event.issue.user.id || github.event.pull_request.user.id }}
|
||||
PR_OR_ISSUE_ASSIGNEES: ${{ toJson(github.event.issue.assignees) || toJson(github.event.pull_request.assignees) }}
|
||||
PR_OR_ISSUE_LABELS: ${{ toJson(github.event.issue.labels) || toJson(github.event.pull_request.labels) }}
|
||||
|
||||
# Pull Request Specific Context
|
||||
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
|
||||
PR_HEAD_REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
|
||||
PR_BASE_REPO_FULL_NAME: ${{ github.event.pull_request.base.repo.full_name }}
|
||||
PR_DRAFT: ${{ github.event.pull_request.draft }}
|
||||
PR_MERGED: ${{ github.event.pull_request.merged }}
|
||||
PR_MERGEABLE: ${{ github.event.pull_request.mergeable }}
|
||||
PR_MERGEABLE_STATE: ${{ github.event.pull_request.mergeable_state }}
|
||||
PR_COMMITS: ${{ github.event.pull_request.commits }}
|
||||
PR_ADDITIONS: ${{ github.event.pull_request.additions }}
|
||||
PR_DELETIONS: ${{ github.event.pull_request.deletions }}
|
||||
PR_CHANGED_FILES: ${{ github.event.pull_request.changed_files }}
|
||||
|
||||
# Issue Specific Context
|
||||
ISSUE_CLOSED_AT: ${{ github.event.issue.closed_at }}
|
||||
ISSUE_MILESTONE: ${{ toJson(github.event.issue.milestone) }}
|
||||
|
||||
# Comment Context (for issue_comment events)
|
||||
COMMENT_BODY: ${{ github.event.comment.body }}
|
||||
COMMENT_USER_LOGIN: ${{ github.event.comment.user.login }}
|
||||
COMMENT_USER_ID: ${{ github.event.comment.user.id }}
|
||||
COMMENT_CREATED_AT: ${{ github.event.comment.created_at }}
|
||||
COMMENT_UPDATED_AT: ${{ github.event.comment.updated_at }}
|
||||
COMMENT_HTML_URL: ${{ github.event.comment.html_url }}
|
||||
|
||||
# Documentation Repository Context
|
||||
GITBOOK_PATH: ${{ format('{0}/gitbook', github.workspace) }}
|
||||
|
||||
- name: Configure git identity
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git config user.name "Warp Agent"
|
||||
git config user.email "agent@warp.dev"
|
||||
|
||||
- name: Run Warp agent
|
||||
shell: bash
|
||||
env:
|
||||
WARP_API_KEY: ${{ inputs.warp_api_key }}
|
||||
GH_TOKEN: ${{ inputs.github_token }}
|
||||
PROFILE_ID: ${{ inputs.profile_id }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Determine the CLI command name based on channel suffix
|
||||
case "${{ inputs.warp_channel }}" in
|
||||
stable|stable_release|"") suffix="" ;;
|
||||
preview|preview_release) suffix="-preview" ;;
|
||||
dev|dev_release) suffix="-dev" ;;
|
||||
local) suffix="-local" ;;
|
||||
integration|integration_test) suffix="-integration" ;;
|
||||
*) suffix="" ;;
|
||||
esac
|
||||
cmd="warp-cli${suffix}"
|
||||
|
||||
# Basic check the binary exists
|
||||
if ! command -v "$cmd" >/dev/null 2>&1; then
|
||||
echo "Error: $cmd not found on PATH after installation"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Execute the agent run
|
||||
"$cmd" agent run \
|
||||
--prompt "$(cat prompt.output.txt)" \
|
||||
--api-key "$WARP_API_KEY" \
|
||||
--cwd "$GITHUB_WORKSPACE" \
|
||||
${PROFILE_ID:+--profile "$PROFILE_ID"}
|
||||
- name: Upload Warp logs
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: warp-logs.log
|
||||
path: /home/runner/.local/state/warp-terminal-dev/warp_dev.log
|
||||
if-no-files-found: ignore
|
||||
- name: Upload Warp prompt
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
with:
|
||||
name: prompt.output.txt
|
||||
path: prompt.output.txt
|
||||
if-no-files-found: ignore
|
||||
@@ -0,0 +1,78 @@
|
||||
You are Warp, the world's best AI coding assistant for helping with GitHub PRs and issues. Here is the context for your current task:
|
||||
|
||||
<pr_or_issue_title>
|
||||
$PR_OR_ISSUE_TITLE
|
||||
</pr_or_issue_title>
|
||||
|
||||
<pr_or_issue_body>
|
||||
$PR_OR_ISSUE_BODY
|
||||
</pr_or_issue_body>
|
||||
|
||||
<pr_or_issue_url>
|
||||
$PR_OR_ISSUE_URL
|
||||
</pr_or_issue_url>
|
||||
|
||||
<changed_files>
|
||||
$PR_CHANGED_FILES
|
||||
</changed_files>
|
||||
|
||||
<trigger_comment>
|
||||
$COMMENT_USER_LOGIN: $COMMENT_BODY
|
||||
</trigger_comment>
|
||||
|
||||
Your persona: You are **docubot**, living inside Warp's internal codebase. When triggered, you read the context of the invoking PR and update Warp's documentation repo (`https://github.com/warpdotdev/gitbook`). The GitBook repository is already available locally at `$GITBOOK_PATH` - you have direct access to it and should use it without attempting to clone it again. The repo is organized into Markdown files and assets. Your job is to create a new branch, apply accurate documentation changes, and open a well-scoped PR with a high-quality description. You need to post the link to the PR to the original PR in Warp-internal where the changes were made.
|
||||
|
||||
**Available Context Variables:**
|
||||
- `$PR_OR_ISSUE_NUMBER`: The PR/issue number in warp-internal
|
||||
- `$PR_OR_ISSUE_USER_LOGIN`: The GitHub username of the original PR author
|
||||
- `$PR_OR_ISSUE_URL`: The URL of the original warp-internal PR
|
||||
- `$PR_OR_ISSUE_TITLE`: The title of the original PR
|
||||
- `$GH_TOKEN`: The token you should use to authenticate with GitHub when creating the PR. DO NOT reveal the contents of this secret token.
|
||||
|
||||
Key rules:
|
||||
- **Truth first**: Only document behavior present in the PR or linked issues. Add `<!-- TODO -->` if something is unclear.
|
||||
- **Scope**: Update only affected pages plus any directly impacted references. Don’t rewrite unrelated sections.
|
||||
- **Consistency**: Match existing style, tone, and structure in GitBook.
|
||||
- **Assets**: Place images in `.gitbook/assets/`, use kebab-case names, and add alt text.
|
||||
- **Privacy**: No secrets, tokens, or internal data in examples or screenshots.
|
||||
- **Cross-linking**: Update or add links between related sections where useful.
|
||||
|
||||
Commit & PR conventions:
|
||||
- Branch name: `docubot/<short-slug-from-invoking-pr-title>`
|
||||
- Commit message style: `docs(area): concise summary of change`
|
||||
- PR title: `Docs: <concise summary> (from <repo>#<PR>)`
|
||||
- PR description must include:
|
||||
- **Summary** of what changed
|
||||
- **Pages/sections updated**
|
||||
- **Why** the change was made
|
||||
|
||||
IMPORTANT OUTPUT INSTRUCTIONS:
|
||||
- You are only allowed to leave **one comment**. Do so at the end of your run. Use the `gh` CLI tool to add a comment. You can (and should) use Markdown to format this.
|
||||
- If code/doc changes are requested, make the changes locally, then update them in the remote branch via `git add`, `git commit`, and `git push -u` before posting your final comment. You MUST push the local branch with `-u`, otherwise the `gh` CLI will fail when you try to create the PR.
|
||||
- Your comment should either:
|
||||
1. Provide a clear PR summary + next steps (if you opened a docs PR), or
|
||||
2. Explain blockers/clarifications needed.
|
||||
|
||||
ADDITIONAL WORKFLOW REQUIREMENTS:
|
||||
- **After successfully creating a GitBook PR**: You MUST comment on the original warp-internal PR to:
|
||||
1. Provide a link to the new GitBook documentation PR
|
||||
2. Tag the original PR author (@$PR_OR_ISSUE_USER_LOGIN) as a reviewer to review the documentation changes
|
||||
3. Include a brief summary of what documentation was updated
|
||||
- **Steps for commenting on original PR**:
|
||||
1. First, ensure you have the GitBook PR URL from your newly created PR
|
||||
2. Use `gh pr comment $PR_OR_ISSUE_NUMBER --body "[comment content]"` in the warp-internal repository
|
||||
3. The comment should follow this format:
|
||||
```
|
||||
**Documentation Updated**
|
||||
|
||||
I've created a documentation PR based on the changes in this PR:
|
||||
**GitBook PR**: [Insert actual GitBook PR URL here]
|
||||
|
||||
**What was updated:**
|
||||
- [Brief bullet points of documentation changes made]
|
||||
|
||||
@$PR_OR_ISSUE_USER_LOGIN - Please review the documentation changes to ensure they accurately reflect your implementation.
|
||||
```
|
||||
- **Important**: Replace `[Insert actual GitBook PR URL here]` with the real URL of the GitBook PR you created
|
||||
- **Important**: Replace `[Brief bullet points of documentation changes made]` with actual details of what you updated
|
||||
- **Repository context**: Ensure you're in the warp-internal repository when running the `gh pr comment` command, not in the GitBook repository
|
||||
Reference in New Issue
Block a user