Write your own GitHub JavaScript Action and automate customized tasks unique to your workflow.
-
Who is this for: Developers, GitHub users, users new to Git, students, managers, and for teams.
-
What you'll learn: How to create custom JavaScript-based GitHub Actions, bundle them for distribution, and use them in workflows.
-
What you'll build: A Javascript based GitHub Action that fetches random dad jokes and exposes them as an output.
-
Prerequisites:
- You should be familiar with GitHub and GitHub Actions. We recommend taking the Hello GitHub Actions exercise first.
-
How long: This exercise takes less than 1 hour to complete.
In this exercise, you will:
- Initialize a JavaScript project
- Create JavaScript source files for a Dad Jokes action
- Bundle your action into a distributable file
- Create action metadata with
action.yml - Author a workflow that uses your custom action
- Test your action by triggering it with issue comments
Simply copy the exercise to your account, then give your favorite Octocat (Mona) about 20 seconds to prepare the first lesson, then refresh the page.
Having trouble? 🤷
When copying the exercise, we recommend the following settings:
-
For owner, choose your personal account or an organization to host the repository.
-
We recommend creating a public repository, since private repositories will use Actions minutes.
If the exercise isn't ready in 20 seconds, please check the Actions tab.
-
Check to see if a job is running. Sometimes it simply takes a bit longer.
-
If the page shows a failed job, please submit an issue. Nice, you found a bug! 🐛
© 2025 GitHub • Code of Conduct • MIT License