Use this to kickstart building an Action with Ruby.
- In your Repository, create a new folder for your Action under
.github/
.
mkdir .github/my_ruby_action
cd .github/my_ruby_action
- Next, copy
Dockerfile
,entrypoint.sh
andaction.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
- Commit and push up your changes.
- 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.
Be sure to click GITHUB_TOKEN
so that your Action can use the GitHub API.
- Commit your change.
Now the fun part. Trigger your event by commenting on an issue in your repo. Then check the Actions tab to see your Action run.
Take a look at the logs and you'll see the output from the puts
calls in your Ruby script. โจ