Skip to content
Open
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
41 changes: 36 additions & 5 deletions .github/workflows/close-single-word-issues.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
name: Close Single-Word Issues
name: Close Non-Descriptive Issues

# This workflow automatically closes issues with non-descriptive titles to maintain
# issue quality. It detects and closes:
# 1. Single-word titles (e.g., "bug", "help")
# 2. Very short titles (< 10 characters) with fewer than 3 words
# 3. Vague phrases in multiple languages (English, Arabic, Chinese, Japanese)
# Examples: "open app", "فتح اتطبيق", "打开应用", etc.
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

Spelling error in the Arabic example: "فتح اتطبيق" should be "فتح التطبيق" (the definite article "ال" is misspelled as "ات").

Suggested change
# Examples: "open app", "فتح اتطبيق", "打开应用", etc.
# Examples: "open app", "فتح التطبيق", "打开应用", etc.

Copilot uses AI. Check for mistakes.
#
# Issues are labeled as 'invalid' and closed with a helpful message encouraging
# users to open a new issue with a more descriptive title.

on:
issues:
Expand All @@ -13,20 +23,41 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Close Single-Word Issue
- name: Close Non-Descriptive Issue
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issueTitle = context.payload.issue.title.trim();
// Check if it's a single word (no whitespace)
const isSingleWord = /^\S+$/.test(issueTitle);
if (isSingleWord) {
// Check if title is too short (less than 10 characters)
const isTooShort = issueTitle.length < 10;
// Count words (split by whitespace and filter out empty strings)
const words = issueTitle.split(/\s+/).filter(word => word.length > 0);
const hasFewerThanThreeWords = words.length < 3;
// Check if title contains only very common/vague words
const vaguePhrases = [
/^(open|close|start|stop|launch|run|help|issue|problem|bug|error|fix)\s*(the|an|a)?\s*(app|application|program|cli|tool|issue)?$/i,
/^(فتح|إغلاق|مساعدة|مشكلة|خطأ)\s*([اأإ]?[تل]?تطبيق|[اأإ]?[تل]?برنامج)?$/, // Arabic
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The Arabic regex pattern has an error: [اأإ]?[تل]?تطبيق won't correctly match "التطبيق" (with definite article). The pattern should be [اأإ]?[لت]?تطبيق or better yet ([اأإ]لتطبيق|تطبيق) to match both "تطبيق" and "التطبيق" forms. The same issue applies to "برنامج".

Suggested change
/^(فتح|إغلاق|مساعدة|مشكلة|خطأ)\s*([اأإ]?[تل]?تطبيق|[اأإ]?[تل]?برنامج)?$/, // Arabic
/^(فتح|إغلاق|مساعدة|مشكلة|خطأ)\s*(([اأإ]لتطبيق|تطبيق)|([اأإ]لبرنامج|برنامج))?$/, // Arabic

Copilot uses AI. Check for mistakes.
/^(开|关|打开|关闭|启动|帮助|问题|错误)\s*(应用|程序)?$/, // Chinese
/^(開く|閉じる|起動|ヘルプ|問題|エラー)\s*(アプリ|プログラム)?$/, // Japanese
];
const isVaguePhrase = vaguePhrases.some(pattern => pattern.test(issueTitle));
const shouldClose = isSingleWord || (isTooShort && hasFewerThanThreeWords) || isVaguePhrase;
if (shouldClose) {
const issueNumber = context.payload.issue.number;
const repo = context.repo.repo;
// Close the issue and add the invalid label
github.rest.issues.update({
await github.rest.issues.update({
owner: context.repo.owner,
repo: repo,
issue_number: issueNumber,
Expand All @@ -39,6 +70,6 @@ jobs:
owner: context.repo.owner,
repo: repo,
issue_number: issueNumber,
body: `This issue may have been opened accidentally. I'm going to close it now, but feel free to open a new issue with a more descriptive title.`
body: `This issue may have been opened accidentally or has a non-descriptive title. I'm going to close it now, but feel free to open a new issue with a more descriptive title that explains the problem or feature request in detail.`
});
}