fix(ci): remove review events from sisyphus-agent for fork PR support

🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-26 03:53:39 +09:00
parent 27b5c1fda3
commit f9234a6a5e

View File

@@ -6,12 +6,10 @@ on:
prompt: prompt:
description: "Custom prompt" description: "Custom prompt"
required: false required: false
# Only issue_comment works for fork PRs (secrets available)
# pull_request_review/pull_request_review_comment do NOT get secrets for fork PRs
issue_comment: issue_comment:
types: [created] types: [created]
pull_request_review:
types: [submitted]
pull_request_review_comment:
types: [created]
jobs: jobs:
agent: agent:
@@ -19,9 +17,9 @@ jobs:
# @sisyphus-dev-ai mention only (maintainers, exclude self) # @sisyphus-dev-ai mention only (maintainers, exclude self)
if: | if: |
github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_dispatch' ||
(contains(github.event.comment.body || github.event.review.body, '@sisyphus-dev-ai') && (contains(github.event.comment.body, '@sisyphus-dev-ai') &&
(github.event.comment.user.login || github.event.review.user.login) != 'sisyphus-dev-ai' && github.event.comment.user.login != 'sisyphus-dev-ai' &&
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association || github.event.review.author_association)) contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association))
# Minimal default GITHUB_TOKEN permissions # Minimal default GITHUB_TOKEN permissions
permissions: permissions:
@@ -231,9 +229,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_PAT }} GITHUB_TOKEN: ${{ secrets.GH_PAT }}
EVENT_NAME: ${{ github.event_name }} EVENT_NAME: ${{ github.event_name }}
ISSUE_NUMBER: ${{ github.event.issue.number }} ISSUE_NUMBER: ${{ github.event.issue.number }}
PR_NUMBER: ${{ github.event.pull_request.number }} COMMENT_BODY: ${{ github.event.comment.body }}
COMMENT_BODY: ${{ github.event.comment.body || github.event.review.body }} COMMENT_AUTHOR: ${{ github.event.comment.user.login }}
COMMENT_AUTHOR: ${{ github.event.comment.user.login || github.event.review.user.login }}
COMMENT_ID_VAL: ${{ github.event.comment.id }} COMMENT_ID_VAL: ${{ github.event.comment.id }}
REPO: ${{ github.repository }} REPO: ${{ github.repository }}
run: | run: |
@@ -250,16 +247,6 @@ jobs:
echo "type=issue" >> $GITHUB_OUTPUT echo "type=issue" >> $GITHUB_OUTPUT
echo "number=${ISSUE_NUM}" >> $GITHUB_OUTPUT echo "number=${ISSUE_NUM}" >> $GITHUB_OUTPUT
fi fi
elif [[ "$EVENT_NAME" == "pull_request_review_comment" ]]; then
echo "type=pr" >> $GITHUB_OUTPUT
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
AUTHOR="$COMMENT_AUTHOR"
COMMENT_ID="$COMMENT_ID_VAL"
elif [[ "$EVENT_NAME" == "pull_request_review" ]]; then
echo "type=pr" >> $GITHUB_OUTPUT
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
AUTHOR="$COMMENT_AUTHOR"
COMMENT_ID=""
fi fi
echo "comment<<EOF" >> $GITHUB_OUTPUT echo "comment<<EOF" >> $GITHUB_OUTPUT