name: Close Issue with Banned Phrases on: issues: types: [opened] jobs: close-issue: runs-on: ubuntu-latest permissions: issues: write steps: - name: Checkout repository uses: actions/checkout@v4 - 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" "bluesky" "spotify" "behance" "pix" "x.com") # 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](https://github.com/lucide-icons/lucide/issues?q=is%3Aissue+$PHRASE) to find similar issues. Read more about brand guideline rules at [We're not accepting new Brand icons #670](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 }} - name: Check for latest version in issue body env: ISSUE_BODY: ${{ github.event.issue.body }} GH_TOKEN: ${{ github.token }} run: | git fetch --tags LATEST_VERSION="$(git describe --tags `git rev-list --tags --max-count=1`)" echo "LATEST_VERSION: $LATEST_VERSION" if grep -q "Can you reproduce this in the latest version?" <<< "$ISSUE_BODY" && ! grep -q "$LATEST_VERSION" <<< "$ISSUE_BODY"; then gh issue close ${{ github.event.issue.number }} --reason "not planned" --comment "**Can you reproduce this in the latest version?** Having issues finding/importing an icon? Ensure you are using a version that is new enough! ![in the icon preview top right corner of lucide.com you can find the required version](https://github.com/lucide-icons/lucide/blob/d5425d3d36d07f869216cc6365a15426ca7474f5/.github/close-issue-missing-version-image.png?raw=true) " exit 1 fi