Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/ai-assistant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,30 @@ jobs:
github.event.issue.pull_request &&
github.event.comment.user.type != 'Bot' &&
contains(github.event.comment.body, inputs.trigger-phrase) &&
github.event.comment.body != format('{0} review', inputs.trigger-phrase)
github.event.comment.body != format('{0} review', inputs.trigger-phrase) &&
!startsWith(github.event.comment.body, format('{0} review close', inputs.trigger-phrase))
) || (
github.event_name == 'pull_request_review_comment' &&
github.event.comment.user.type != 'Bot' &&
contains(github.event.comment.body, inputs.trigger-phrase) &&
github.event.comment.body != format('{0} review', inputs.trigger-phrase)
github.event.comment.body != format('{0} review', inputs.trigger-phrase) &&
!startsWith(github.event.comment.body, format('{0} review close', inputs.trigger-phrase))
) || (
github.event_name == 'pull_request_review' &&
github.event.review.user.type != 'Bot' &&
github.event.review.body &&
contains(github.event.review.body, inputs.trigger-phrase) &&
github.event.review.body != format('{0} review', inputs.trigger-phrase)
github.event.review.body != format('{0} review', inputs.trigger-phrase) &&
!startsWith(github.event.review.body, format('{0} review close', inputs.trigger-phrase))
)
permissions:
pull-requests: write # post the reply / in-thread reply
issues: write # reply on the PR conversation timeline
id-token: write # Anthropic workload identity federation (OIDC)
steps:
# The review workflow owns the exact `@seidroid review` command. Reserving it here
# prevents the conversational assistant from posting a competing generic response.
# The review workflow owns `@seidroid review` and `@seidroid review close`. Reserving
# both here prevents the conversational assistant from posting a competing generic
# response. Close matches as a prefix, the way the caller's close job routes it.
- name: Route request
id: route
uses: actions/github-script@v9
Expand All @@ -106,9 +110,9 @@ jobs:
script: |
const normalize = value =>
String(value || "").trim().replace(/\s+/g, " ").toLowerCase();
const isReview =
normalize(process.env.BODY) ===
`${normalize(process.env.TRIGGER_PHRASE)} review`;
const body = normalize(process.env.BODY);
const review = `${normalize(process.env.TRIGGER_PHRASE)} review`;
const isReview = body === review || body.startsWith(`${review} close`);
core.setOutput("is_review_command", String(isReview));

- name: Generate GitHub App token
Expand Down
Loading