Write your own GitHub JavaScript Action and automate customized tasks unique to your workflow.
Let's keep going! 🚲
Now that we have the custom action pre-requisites, let us create joke-action action.
All of the following steps take place inside of the .github/actions/joke-action
directory.
We will start with using the parameters that are required and later implement some optional parameters as our action evolves.
-
Create a new file in:
.github/actions/joke-action/action.yml
-
Add the following contents to the
.github/actions/joke-action/action.yml
file:name: "my joke action" description: "use an external API to retrieve and display a joke" runs: using: "node16" main: "main.js"
-
Save the
action.yml
file -
Commit the changes and push them to the
main
branch:git add action.yml git commit -m 'create action.yml' git pull git push
-
Wait about 20 seconds then refresh this page (the one you're following instructions from). GitHub Actions will automatically update to the next step.
Get help: Post in our discussion board • Review the GitHub status page
© 2023 GitHub • Code of Conduct • MIT License