DEV Community

Pushpendra Singh
Pushpendra Singh

Posted on

7 1

My First Github Action, using JavaScript.

Hackathons are inspiring, I have been wanting to explore Github Actions for a while now, but I was always able to find some reasons to push it down in my to-do list.

Since the Dev.to Github Action hackathon is announced, I couldn't resist it, I jumped right into it.

And today, I created my first Github Action using JavaScript.

My Workflow

I have managed to create a Github Action which replaces text in your Github comment with emojis, comments from issues and PRs are translated.

It was created mostly with reasons to get started with Github Actions.

I explored

  • Creating a Github Action using JS.
  • Using libraries in my action.
  • Using Github Context in my action.
  • Writing workflows.

Submission Category:

Comments Emoji will fits fine with Wacky Wildcards.

Code

Add following YML in your workflow to get started.

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 }}

You can find the code for the action at

GitHub logo dreamer01 / comments-emoji

A Github Action to convert your comment message to emojis.

Resources

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay