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
14 changes: 3 additions & 11 deletions .github/workflows/doc_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,9 @@ jobs:
(
github.event_name == 'issue_comment' &&
contains(github.event.comment.body, '/bot-review') &&
contains('hfxsd,likidu,lilin90,Oreoxmt,qiancai', github.event.comment.user.login)
(github.event.comment.user.login == 'hfxsd' || github.event.comment.user.login == 'likidu' || github.event.comment.user.login == 'lilin90' || github.event.comment.user.login == 'Oreoxmt' || github.event.comment.user.login == 'qiancai')
)
steps:
- name: Debug Info
run: |
echo "Event name: ${{ github.event_name }}"
echo "Event type: ${{ github.event.action }}"
echo "Comment body: ${{ github.event.comment.body || 'No comment body' }}"
echo "Comment author: ${{ github.event.comment.user.login || 'No user' }}"

- name: Checkout Repo
uses: actions/checkout@v3
with:
Expand All @@ -40,20 +33,19 @@ jobs:
if: github.event_name == 'issue_comment'
run: |
COMMENT="${{ github.event.comment.body }}"
echo "Raw comment: $COMMENT"

# Match commit range
if [[ "$COMMENT" =~ \/bot-review:[[:space:]]*([a-f0-9]{7,40})[[:space:]]*\.\.[[:space:]]*([a-f0-9]{7,40}) ]]; then
echo "BASE_SHA=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
echo "HEAD_SHA=${BASH_REMATCH[2]}" >> $GITHUB_OUTPUT
echo "REVIEW_MODE=commit_range" >> $GITHUB_OUTPUT
echo "Detected commit range with regex: ${BASH_REMATCH[1]}..${BASH_REMATCH[2]}"
printf "Detected commit range with regex: %s..%s\\n" "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}"

# Match a single commit
elif [[ "$COMMENT" =~ \/bot-review:[[:space:]]+([a-f0-9]{7,40}) ]]; then
echo "COMMIT_SHA=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
echo "REVIEW_MODE=single_commit" >> $GITHUB_OUTPUT
echo "Detected single commit: ${BASH_REMATCH[1]}"
printf "Detected single commit: %s\\n" "${BASH_REMATCH[1]}"

# Match "/bot-review" or "/bot-review "
elif [[ "$COMMENT" =~ ^\/bot-review[[:space:]]*$ ]]; then
Expand Down