Github action that checks the toxicity level of comments and PR reviews to help make repos safe spaces.
Go to file
2020-08-16 15:05:52 +02:00
.github/workflows add gitignore and example workflow 2020-08-16 15:05:52 +02:00
dist first commit 2020-08-16 14:57:47 +02:00
.gitignore add gitignore and example workflow 2020-08-16 15:05:52 +02:00
action.yml first commit 2020-08-16 14:57:47 +02:00
demo.gif first commit 2020-08-16 14:57:47 +02:00
LICENSE.md first commit 2020-08-16 14:57:47 +02:00
package-lock.json first commit 2020-08-16 14:57:47 +02:00
package.json first commit 2020-08-16 14:57:47 +02:00
README.md first commit 2020-08-16 14:57:47 +02:00

Don't you know that you're toxic - Github action

Github action that uses machine learning to detect potential toxic comments added to PRs and issues so authors can have a chance to edit them and keep repos a safe space.

It uses the Tensorflow.js toxicity classification model.

It currently works when comments are posted on issues and PRs, as well as when pull request reviews are submitted.

Demo

How to use

If you do not have any Github action already set up in your repo, start by creating a .github/workflows folder.

Inside your workflows folder, create a new .yml file, for example main.yml and copy the following lines:

on: [issue_comment, pull_request_review]

jobs:
  toxic_check:
    runs-on: ubuntu-latest
    name: Don't you know that you're toxic
    steps:
      - uses: actions/checkout@v2
      - name: Don't you know that you're toxic - action step
        uses: charliegerard/dont-you-know-that-youre-toxic@master
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

GITHUB_TOKEN is required but two other parameters are optional:

  • message - a custom message you'd like to display in the automatic comment
  • toxicity_threshold - a float number between 0 and 1. It will used when loading the machine learning model. Its default value is 0.9.
on: [issue_comment, pull_request_review]

jobs:
  toxic_check:
    runs-on: ubuntu-latest
    name: Don't you know that you're toxic
    steps:
      - uses: actions/checkout@v2
      - name: Don't you know that you're toxic - action step
        uses: charliegerard/dont-you-know-that-youre-toxic@master
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          message: "this is my custom message"
          toxicity_threshold: 0.7