Skip to content

Commit dfd459c

Browse files
authored
Update feature_greetings.yml
1 parent 440ad54 commit dfd459c

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/feature_greetings.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,27 @@ jobs:
3232
echo "The issue creator is the repository owner. Skipping greeting message."
3333
echo "skip=true" >> $GITHUB_ENV
3434
else
35-
echo "The issue creator is not the repository owner. Sending greeting message."
35+
echo "The issue creator is not the repository owner. Checking for previous feature requests."
3636
echo "skip=false" >> $GITHUB_ENV
3737
fi
3838
39+
- name: Check for Previous Feature Requests
40+
if: env.skip == 'false'
41+
id: check_previous_requests
42+
run: |
43+
ISSUE_AUTHOR=$(jq -r '.issue.user.login' "$GITHUB_EVENT_PATH")
44+
RESPONSE=$(curl -s "https://api.github.com/search/issues?q=author:${ISSUE_AUTHOR}+label:\"New Feature\"+repo:${GITHUB_REPOSITORY}")
45+
COUNT=$(echo "$RESPONSE" | jq -r '.total_count')
46+
if [ "$COUNT" -gt 0 ]; then
47+
echo "This user has made previous feature requests. Skipping greeting message."
48+
echo "first_time=false" >> $GITHUB_ENV
49+
else
50+
echo "This is the user's first feature request. Sending greeting message."
51+
echo "first_time=true" >> $GITHUB_ENV
52+
fi
53+
3954
- name: Send Greeting Message
40-
if: env.skip_label_check == 'false' && env.skip != 'true'
55+
if: env.skip_label_check == 'false' && env.skip != 'true' && env.first_time == 'true'
4156
uses: actions/github-script@v6
4257
with:
4358
script: |

0 commit comments

Comments
 (0)