Skip to content

Commit db7bc88

Browse files
memodiclaude
andcommitted
Fix workflow execution issues and add debugging
- Remove restrictive fork condition that was causing steps to be skipped - Add comprehensive debugging output to diagnose event and condition issues - Make PR condition more explicit with != null check - Ensure proper permissions are set on all jobs This should resolve: 1. needs-changes.yaml steps being skipped 2. needs-review.yaml not executing on "/needs-review" comments 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent a8e5c4f commit db7bc88

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

.github/workflows/needs-changes.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ jobs:
1515
pull-requests: write
1616
steps:
1717
- name: Handle review submission
18-
if: github.event_name == 'pull_request_review' && github.event.pull_request.head.repo.full_name == github.repository
18+
if: github.event_name == 'pull_request_review'
1919
run: |
20+
echo "Event name: ${{ github.event_name }}"
21+
echo "PR number: ${{ github.event.pull_request.number }}"
22+
echo "Review state: ${{ github.event.review.state }}"
23+
echo "Repository: ${{ github.repository }}"
24+
2025
PR_NUMBER=${{ github.event.pull_request.number }}
2126
REVIEW_STATE="${{ github.event.review.state }}"
2227
@@ -28,6 +33,8 @@ jobs:
2833
if [[ "$REVIEW_STATE" == "changes_requested" ]] || [[ "$REVIEW_STATE" == "commented" ]]; then
2934
echo "Adding needs-changes label for $REVIEW_STATE review"
3035
gh pr edit $PR_NUMBER --add-label needs-changes || echo "Failed to add needs-changes label or label already exists"
36+
else
37+
echo "Review state $REVIEW_STATE does not trigger needs-changes label"
3138
fi
3239
env:
3340
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/needs-review.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,23 @@ jobs:
2828
runs-on: ubuntu-latest
2929
permissions:
3030
pull-requests: write
31-
if: github.event_name == 'issue_comment' && github.event.issue.pull_request
31+
if: github.event_name == 'issue_comment' && github.event.issue.pull_request != null
3232
steps:
3333
- name: Add needs-review label via comment
3434
run: |
35+
echo "Event name: ${{ github.event_name }}"
36+
echo "Issue number: ${{ github.event.issue.number }}"
37+
echo "Comment body: ${{ github.event.comment.body }}"
38+
echo "Is PR: ${{ github.event.issue.pull_request != null }}"
39+
3540
COMMENT_BODY="${{ github.event.comment.body }}"
3641
COMMENT_LOWER=$(echo "$COMMENT_BODY" | tr '[:upper:]' '[:lower:]')
3742
3843
if [[ "$COMMENT_LOWER" == *"needs-review"* ]] || [[ "$COMMENT_LOWER" == *"/needs-review"* ]]; then
3944
echo "Adding needs-review label via comment"
4045
gh pr edit ${{ github.event.issue.number }} --add-label needs-review || echo "Failed to add label or label already exists"
46+
else
47+
echo "Comment does not contain needs-review trigger"
4148
fi
4249
env:
4350
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)