Skip to content

A GitHub action that monitors PR/issue comments and warns senders who used offensive language.

License

Notifications You must be signed in to change notification settings

tailaiw/mind-your-language-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Mind your language action

This action monitor comments to issues and pull requests, and remind the sender if offensive language is found.

Example usage

Create the following workflow file mind-your-language.yml in the .github/workflows/ directory of your repository:

name: Mind your language
on:
  issues:
    types:
      - opened
      - edited
  issue_comment:
    types:
      - created
      - edited
  pull_request_review_comment:
    types:
      - created
      - edited
jobs:
  echo_issue_comment:
    runs-on: ubuntu-latest
    name: profanity check
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Profanity check step
        uses: tailaiw/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Workflow

Whenever a comment to an issue or pull request is created, the work flow will perform profanity check against the comment text and take reaction if offensive language is found.

Profanity Check

I am currently using profanity-check, a Python package of profanity detection based on machine learning, to determine whether a comment is offensive or not. It is not super powerful but is sensitive to obvious offensive language. I hope I may use some cutting-edge NLP algorithms to get better performance. I will create a separate repo to pursue better alternatives soon. If you are interested in it, stay tuned.

Reaction

The reaction right now is an auto-reply by github-actions bot that mentions the sender of offensive comment. See the example as following.

example.png

Contributing

I'm a new developer of github action, so suggestion and help are more than welcome. Of course, "Mind your language" 😄