8000 Introducing an Auto-Comment Feature to Handle Inappropriate or Anonymous Interactions by LimHyungTae · Pull Request #21 · MIT-SPARK/KISS-Matcher · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Introducing an Auto-Comment Feature to Handle Inappropriate or Anonymous Interactions #21

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

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/issue_comment.yml
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! 🚀"
})
0