forked from lucide-icons/lucide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added .github/workflows/close-issue-with-banned-phrases.yml
- Loading branch information
Showing
1 changed file
with
35 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,35 @@ | ||
name: Close Issue with Banned Phrases | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
|
||
jobs: | ||
block_phrases: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Check for blocked phrases in issue title | ||
run: | | ||
ISSUE_TITLE=$(jq -r '.issue.title' "$GITHUB_EVENT_PATH") | ||
BLOCKED_PHRASES=("twitter" "whatsapp" "logo" "google" "tiktok" "facebook" "slack" "discord") | ||
# Check title and body for blocked phrases | ||
for PHRASE in "${BLOCKED_PHRASES[@]}" | ||
do | ||
if echo "$ISSUE_TITLE" | grep -i "$PHRASE"; then | ||
gh issue close ${{ github.event.issue.number }} --reason "not planned" --comment "This looks like a duplicate, use the search to find similar issues. | ||
https://github.com/lucide-icons/lucide/issues/670 | ||
Always happy to help on [Discord](https://discord.gg/EH6nSts)." | ||
gh issue lock ${{ github.event.issue.number }} --reason spam | ||
exit 1 | ||
fi | ||
done | ||
env: | ||
GH_TOKEN: ${{ github.token }} |