-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f88aa75
commit 10d5c73
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Auto Comment on Short Issues | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
|
||
jobs: | ||
comment_on_short_issue: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check issue body length | ||
id: check_length | ||
run: | | ||
BODY="${{ github.event.issue.body }}" | ||
LENGTH=$(echo "$BODY" | wc -c) | ||
if [ "$LENGTH" -lt 80 ]; then | ||
echo "short=true" >> $GITHUB_ENV | ||
else | ||
echo "short=false" >> $GITHUB_ENV | ||
fi | ||
- name: Comment on short issue | ||
if: env.short == 'true' | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number, | ||
body: "👋 Thanks for your issue! However, it looks too short to help you in details. Could you provide more details such as:\n\n- A clear description of the problem\n- Steps to reproduce\n- Expected vs. actual behavior\n- Your environment (OS, software version, etc.)\n\nThis will help us investigate the issue effectively. Thanks! 🚀" | ||
}) |