Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature:Developer] Excessive welcome message #10552

Merged
merged 6 commits into from
Jun 21, 2024

Conversation

ZheyuDeng
Copy link
Contributor

Fix #10544

What is the current behavior?

Welcome message can be sent multple time to same user in a issue which can be pretty annouying for first time contributor
See the comment section in this issue for reference
#10475

What is the new behavior?

Welcome message will only be sent at most once to each user.
image

See ZheyuDeng#4

Now the welcome message will only be sent once to each new user
@ZheyuDeng ZheyuDeng self-assigned this Jun 14, 2024
@ZheyuDeng ZheyuDeng changed the title [Feature:Developer] Welcome message duplication [Feature:Developer] Excessive welcome message Jun 14, 2024
Copy link
Contributor

@micpap25 micpap25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't test the github action but I ran in command line and noticed a potential problem, is this happening on your end?

id: check-comments
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
BOT_COMMENT_EXISTS=$(gh issue view "$ISSUE_NUMBER" --json comments --jq '.comments[].body' | grep -q "Hi @$USERNAME," && echo "true" || echo "false")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My command line is giving me issues with parsing the single quote on the jq expression. Are you certain this works?

Copy link
Contributor Author

@ZheyuDeng ZheyuDeng Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran it in my wsl and also wrote a test file I think it is working fine. You can also check my repo/Create a repo and replace the .github/workflows/first_issue_reply.yml file with the one in this PR and see if it works.

Below is my test file and result:
As you can see it checks if the user "testing-github-actionn" get the welcome message which returned true at the bottom of the second sreeenshot. This test file went through ZheyuDeng#5.

image
image

@ZheyuDeng ZheyuDeng requested a review from micpap25 June 20, 2024 20:45
@bmcutler bmcutler merged commit cd9913d into main Jun 21, 2024
20 checks passed
@bmcutler bmcutler deleted the First-time-message-duplication branch June 21, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Auto-comment action runs (kind of spams) whenever non-contributor types
3 participants