Skip to content

Commit dcd49c9

Browse files
committed
opencode: distinguish PR Review vs Issue in run-name
The run-name was hardcoded to 'Issue #N' even when the trigger was a pull_request_review_comment (e.g. /oc review on a PR). The number is the same in both cases (PRs are issues in GH's data model), but the label was misleading. Make the run-name conditional on github.event_name: - pull_request_review_comment -> 'PR Review #N - title' - issue_comment -> 'Issue #N - title' Also switched em-dash to hyphen-minus for US-ASCII safety (AGENTS.md). Updated the orchestrator's run-title regex to match both formats: /(?:Issue|PR Review) #(\d+)/ so the orchestrator can still extract the issue/PR number from the workflow_run display_title and decide whether to advance.
1 parent 958b433 commit dcd49c9

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

.github/scripts/orchestrator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,10 @@ module.exports = async ({ github, context, core }) => {
334334
// Fetch the display title of the completed workflow run
335335
const runTitle = context.payload.workflow_run.display_title || '';
336336

337-
// Extract issue number from display title (e.g. "Issue #469 — Add SIMD-accelerated...")
338-
const match = runTitle.match(/Issue #(\d+)/);
337+
// Extract issue/PR number from display title (e.g. "Issue #469 — ..." or "PR Review #471 — ...")
338+
const match = runTitle.match(/(?:Issue|PR Review) #(\d+)/);
339339
if (!match) {
340-
core.info(`Workflow run display title "${runTitle}" does not contain expected "Issue #[number]" format. Skipping.`);
340+
core.info(`Workflow run display title "${runTitle}" does not contain expected "Issue #[number]" or "PR Review #[number]" format. Skipping.`);
341341
return;
342342
}
343343

.github/workflows/opencode.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: opencode
2-
run-name: "Issue #${{ github.event.issue.number }} — ${{ github.event.issue.title }}"
2+
run-name: ${{ github.event_name == 'pull_request_review_comment' && format('PR Review #{0} - {1}', github.event.pull_request.number, github.event.pull_request.title) || format('Issue #{0} - {1}', github.event.issue.number, github.event.issue.title) }}
33

44
on:
55
issue_comment:

0 commit comments

Comments
 (0)