DEV Community

Pushpendra Singh
Pushpendra Singh

Posted on

3 1

Adding profanity check to Github comments using Github Action.

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

Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Code for Github Action can be found here.

GitHub logo dreamer01 / comments-emoji

A Github Action to convert your comment message to emojis.

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

Top comments (0)

Image of PulumiUP 2025

Let's talk about the current state of cloud and IaC, platform engineering, and security.

Dive into the stories and experiences of innovators and experts, from Startup Founders to Industry Leaders at PulumiUP 2025.

Register Now

πŸ‘‹ Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay