Examples

Real-world recipes.

Pick the recipe that matches your setup. Every example is copy-pasteable and ready for production.

🚀 Basic emoji replacement

The simplest end-to-end workflow. Replaces any detected profane content with a random emoji and posts a job summary.

.github/workflows/profanity-filter.yml yaml
name: Profanity filter

on:
  issues:
    types: [opened, edited, reopened]
  pull_request:
    types: [opened, edited, reopened]
  issue_comment:
    types: [created, edited]

permissions:
  issues: write
  pull-requests: write

jobs:
  apply-filter:
    runs-on: ubuntu-latest
    steps:
      - name: Scan for profanity
        if: github.actor != 'dependabot[bot]'
        uses: IEvangelist/profanity-filter@main
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          replacement-strategy: emoji

🧠 Custom inline words

Add a comma-separated list on top of the built-in dictionary. Useful for project-specific terminology.

- name: Scan for profanity
  uses: IEvangelist/profanity-filter@main
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    replacement-strategy: middle-asterisk
    # Add your own words on top of the 4,900+ built-in
    manual-profane-words: foo,bar,baz

🌐 Custom words from a URL

Centralize a shared list across repos by hosting a newline-delimited text file at any URL.

- name: Scan for profanity
  uses: IEvangelist/profanity-filter@main
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    replacement-strategy: bleep
    # Pull words from any URL that returns newline-delimited text
    custom-profane-words-url: https://example.com/words.txt

😡 Anger emojis + confused reaction

Add a bit of personality. The bot reacts to the offending issue or PR with 😕 and replaces words with anger emojis.

- name: Scan for profanity
  uses: IEvangelist/profanity-filter@main
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    replacement-strategy: anger-emoji
    include-confused-reaction: true
    include-updated-note: true

🧱 Composed into an existing workflow

Already have a workflow on issue/PR events? Just add the step. No new file required.

# Drop into an existing workflow that already
# triggers on issues/pull requests
- name: Scan for profanity
  if: github.actor != 'dependabot[bot]'
  uses: IEvangelist/profanity-filter@main
  id: profanity-filter
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    replacement-strategy: first-letter-then-asterisk

- name: Run other checks
  run: |
    echo "Filter step finished, continuing..."

🔁 Reusable workflow

Call the published reusable workflow directly — no individual step copy-paste across repos.

.github/workflows/profanity-filter.yml yaml
# Caller workflow in any repo
name: Profanity filter

on:
  issues:
    types: [opened, edited, reopened]
  pull_request:
    types: [opened, edited, reopened]
  issue_comment:
    types: [created, edited]

jobs:
  filter:
    uses: IEvangelist/profanity-filter/.github/workflows/profanity-filter.yml@main
    with:
      replacement-strategy: emoji
    secrets:
      token: ${{ secrets.GITHUB_TOKEN }}

Need something else?

If your use-case isn't covered here, open an issue or discussion on GitHub — we'll gladly add a recipe.