Build a GitHub Action with Ruby

・1 min read

Want to build a GitHub Action with everyones favorite language?

Here's a quick start for building one with Ruby. ✨

mscoutermarsh / ruby-action-recipe

Quick start recipe for building an Action with Ruby and the GitHub API.

GitHub Action: Ruby Recipe

Use this to kickstart building an Action with Ruby.

Usage

  1. In your Repository, create a new folder for your Action under .github/.
mkdir .github/my_ruby_action
cd .github/my_ruby_action
  1. Next, copy Dockerfile, entrypoint.sh and action.rb from this repository into your new folder.

Here are some easy commands to download them.

curl https://raw.githubusercontent.com/mscoutermarsh/ruby-action-recipe/master/action.rb > action.rb
curl https://raw.githubusercontent.com/mscoutermarsh/ruby-action-recipe/master/Dockerfile > Dockerfile
curl https://raw.githubusercontent.com/mscoutermarsh/ruby-action-recipe/master/entrypoint.sh > entrypoint.sh
  1. Commit and push up your changes.

Running your new Action

  1. Visit the Actions tab for your repository.

Setup your workflow to trigger whenever an Issue receives a comment.

Note: The issue_comment event is currently only available in private repos. If you're doing this in a public repo, use push for now.

  1. Then, drag a line to your new Action.

Be sure to click GITHUB_TOKEN so that your Action can use the GitHub API.

  1. Commit your change.

Trigger the event

Now the fun part. Trigger your…

Fancy gif

DISCUSSION
Classic DEV Post from Feb 5

Clean up your code with these tips!

Learning new patterns to make your code smaller, and more clear.

Mike Coutermarsh
code @github

What are you waiting for? 100,000 other devs have already joined. join dev.to