DEV Community

loading...

Adding profanity check to Github comments using Github Action.

stud2design profile image Pushpendra Singh ・1 min read

I started with building a comments-emoji action which would translate your issue and PR comments to emojis. The idea behind it was to get started with Github Action.

Now, new ideas keep poping and as a result here is another addition to Github Action comments-emoji, this time its something helpful for Open Source Maintainers.

My Workflow

With addition of this new feature, now user can enable profanity check using comments-emoji action.

To benefit this feature, user has to add input enablePolice flag with value "true" in there workflow.

As a result the comments-emoji action will replace all bad words with emoji 🤐.

...
      - name: Comment Emoji - action exe
        uses: dreamer01/comments-emoji@master
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          enablePolice: true

Submission Category:

Maintainer Must-Haves, This will help maintainer to maintain positive and safe environment.

Code

Complete YML file

comments.yml

name: Emoji Comments

on:
  issue_comment:
    types: [created]
  pull_request_review_comment:
    types: [created]

jobs:
  comment-emoji:
    runs-on: ubuntu-latest
    name: Emoji Comments
    steps:
      - uses: actions/checkout@v2
      - name: Comment Emoji - action exe
        uses: dreamer01/comments-emoji@master
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          enablePolice: true

Code for Github Action can be found here.

GitHub logo dreamer01 / comments-emoji

A Github Action to convert your comment message to emojis.

Discussion (0)

pic
Editor guide