feat: trigger on issues opened when @cursor in title or body

Extend check-comment.sh to parse issues event payloads; document
issue_comment + issues opened as supported workflow triggers.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Frank Schwenk
2026-07-05 16:50:21 +02:00
parent 239e110b72
commit 6b6943262d
3 changed files with 19 additions and 7 deletions
+5 -2
View File
@@ -27,6 +27,8 @@ name: Cursor Agent
on:
issue_comment:
types: [created]
issues:
types: [opened]
jobs:
cursor:
@@ -70,7 +72,7 @@ For playground repos that commit directly to the default branch (no PR workflow)
## How it works
When someone mentions `@cursor` in a new issue or PR comment:
When someone mentions `@cursor` in a new issue (title or body), a new issue/PR comment, or similar:
1. The action parses the webhook payload (`GITHUB_EVENT_PATH`) and checks for `@cursor`.
2. Comments from the `cursor` user are ignored to prevent feedback loops.
@@ -93,6 +95,7 @@ You can ask Cursor to review a PR, refine a feature request, or implement a chan
## Supported events
- `issue_comment` with `types: [created]` — issue and PR timeline comments (recommended)
- `issue_comment` with `types: [created]` — issue and PR timeline comments
- `issues` with `types: [opened]` — new issue if `@cursor` appears in title or body
`pull_request_review_comment` is not enabled by default: Gitea's payload uses a `review` object instead of `comment`, which is easy to get wrong. Open an issue if you need that trigger tested on your Gitea version.
+2 -2
View File
@@ -2,7 +2,7 @@
## Agent Quick Start
- **What:** Gitea composite Action — `@cursor` in issue/PR comments runs Cursor CLI + gitea-mcp on the Actions runner.
- **What:** Gitea composite Action — `@cursor` in issue/PR comments or new issues runs Cursor CLI + gitea-mcp on the Actions runner.
- **Gitea:** https://gitea.schwenk.online — repo `froxxxy/cursor-gitea-agent`
- **Default model:** `composer-2.5` (override via `ai_model` input only when Fränky asks)
- **Runner:** Gitea Actions on `boka`
@@ -14,7 +14,7 @@ cursor-gitea-agent
## One-Liner
Gitea Action that triggers Cursor AI when `@cursor` is mentioned in issue or PR comments.
Gitea Action that triggers Cursor AI when `@cursor` is mentioned in issue/PR comments or new issues.
## Vision
+11 -2
View File
@@ -15,14 +15,18 @@ fi
OUTPUT_FILE="${GITHUB_OUTPUT:?GITHUB_OUTPUT is not set}"
COMMENT_BODY=$(jq -r '
COMMENT_BODY=$(jq -r \
--arg event_name "${GITHUB_EVENT_NAME:-}" \
'
if .comment?.body? then .comment.body
elif .review?.body? then .review.body
elif $event_name == "issues" then
((.issue.title // "") + "\n" + (.issue.body // ""))
else empty end
' "$EVENT_FILE")
if [ -z "$COMMENT_BODY" ]; then
echo "No comment or review body in event payload — skipping."
echo "No @cursor trigger text in event payload — skipping."
echo "run_cursor=false" >> "$OUTPUT_FILE"
exit 0
fi
@@ -63,6 +67,11 @@ jq \
id: .review.id,
user: (.sender.login // "unknown")
}
elif ($event_name == "issues") and .issue then {
body: ((.issue.title // "") + "\n" + (.issue.body // "")),
id: null,
user: (.sender.login // .issue.user.login // "unknown")
}
else null end
),
issue: {