239e110b72
Playground repos can push directly to the default branch instead of opening PRs; agent runtime is configurable (default 5m). Co-authored-by: Cursor <cursoragent@cursor.com>
54 lines
1.6 KiB
YAML
54 lines
1.6 KiB
YAML
name: Cursor Agent
|
|
description: Run Cursor CLI on @cursor mentions in Gitea issues and pull requests
|
|
inputs:
|
|
cursor_api_key:
|
|
description: Cursor API key
|
|
required: true
|
|
gitea_token:
|
|
description: Gitea API token for the cursor bot user
|
|
required: true
|
|
gitea_base_url:
|
|
description: Gitea instance URL (e.g. https://gitea.schwenk.online)
|
|
required: true
|
|
ai_model:
|
|
description: Cursor model id
|
|
required: false
|
|
default: composer-2.5
|
|
push_to_default_branch:
|
|
description: When true, commit and push directly to the default branch instead of opening a PR
|
|
required: false
|
|
default: "false"
|
|
agent_timeout:
|
|
description: Maximum runtime for the Cursor agent (timeout duration, e.g. 5m, 30m)
|
|
required: false
|
|
default: 5m
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Check comment and capture context
|
|
id: check
|
|
shell: bash
|
|
run: |
|
|
chmod +x "$GITHUB_ACTION_PATH/scripts/"*.sh
|
|
"$GITHUB_ACTION_PATH/scripts/check-comment.sh"
|
|
|
|
- name: Install dependencies
|
|
if: steps.check.outputs.run_cursor == 'true'
|
|
shell: bash
|
|
run: |
|
|
"$GITHUB_ACTION_PATH/scripts/install-deps.sh"
|
|
|
|
- name: Run Cursor
|
|
if: steps.check.outputs.run_cursor == 'true'
|
|
shell: bash
|
|
env:
|
|
CURSOR_API_KEY: ${{ inputs.cursor_api_key }}
|
|
GITEA_ACCESS_TOKEN: ${{ inputs.gitea_token }}
|
|
GITEA_BASE_URL: ${{ inputs.gitea_base_url }}
|
|
AI_MODEL: ${{ inputs.ai_model }}
|
|
PUSH_TO_DEFAULT_BRANCH: ${{ inputs.push_to_default_branch }}
|
|
AGENT_TIMEOUT: ${{ inputs.agent_timeout }}
|
|
run: |
|
|
"$GITHUB_ACTION_PATH/scripts/run-cursor.sh"
|