Skip to content

Commit 46b6d14

Browse files
authored
fix: print ready-for-review comment on all ready PRs, not just draft->ready PRs (#9)
1 parent 94bf1be commit 46b6d14

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/pr-auto-comments.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,27 @@ jobs:
4747
run: |
4848
if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then
4949
if [[ "${{ github.event.action }}" == "opened" ]]; then
50-
echo "type=opened" >> $GITHUB_OUTPUT
50+
# Check if PR was opened and is not a draft
51+
if [[ "${{ github.event.pull_request.draft }}" == "false" ]]; then
52+
echo "type=opened" >> $GITHUB_OUTPUT
53+
echo "type_ready=true" >> $GITHUB_OUTPUT
54+
else
55+
echo "type=opened" >> $GITHUB_OUTPUT
56+
echo "type_ready=false" >> $GITHUB_OUTPUT
57+
fi
5158
elif [[ "${{ github.event.action }}" == "ready_for_review" ]]; then
5259
echo "type=ready_for_review" >> $GITHUB_OUTPUT
60+
echo "type_ready=true" >> $GITHUB_OUTPUT
5361
elif [[ "${{ github.event.action }}" == "closed" && "${{ github.event.pull_request.merged }}" == "true" ]]; then
5462
echo "type=merged" >> $GITHUB_OUTPUT
63+
echo "type_ready=false" >> $GITHUB_OUTPUT
5564
else
5665
echo "type=other" >> $GITHUB_OUTPUT
66+
echo "type_ready=false" >> $GITHUB_OUTPUT
5767
fi
5868
else
5969
echo "type=other" >> $GITHUB_OUTPUT
70+
echo "type_ready=false" >> $GITHUB_OUTPUT
6071
fi
6172
6273
- name: Check if external contributor
@@ -150,7 +161,7 @@ jobs:
150161
ready-for-review-comment:
151162
name: Ready for Review Comment
152163
needs: check-contributor
153-
if: needs.check-contributor.outputs.event_type == 'ready_for_review' && needs.check-contributor.outputs.is_external == 'true' && inputs.ready_for_review_comment != ''
164+
if: (needs.check-contributor.outputs.event_type == 'ready_for_review' || (needs.check-contributor.outputs.event_type == 'opened' && needs.check-contributor.outputs.type_ready == 'true')) && needs.check-contributor.outputs.is_external == 'true' && inputs.ready_for_review_comment != ''
154165
runs-on: ubuntu-latest
155166
steps:
156167
- name: Leave ready for review comment

0 commit comments

Comments
 (0)