DEV Community

Pushpendra Singh
Pushpendra Singh

Posted on

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

Top comments (0)