@geored our JavaScript actions are going to leverage the GitHub ToolKit for developing GitHub Actions.
This is an external library that we will install using npm which means that you will need Node.js installed.
I find writing actions to be easier from a local environment vs trying to do everything right here in the repository. Doing these steps locally allows you to use the editor of your choice so that you have all the extensions and snippets you are used to when writing code.
If you do not have a preferred environment then I suggest following along with me exactly as you see on the screen, which means you'll need to install Visual Studio Code.
Don't forget to set up your workstation 😉
Most of your work going forward will take place away from your Learning Lab repository, so before continuing with the course ensure you have the following installed on your local machine.
Create a new branch named hello-world. This is the branch we will use to write our first action. Please do not capitalize letters unless I do, I run case-sensitive checks to make sure I can help you along the way!
git checkout -b hello-world
Create a new folder for our actions files:
mkdir -p .github/actions/hello-world
Navigate to the hello-world folder you just created:
On to your development environment
@geored our JavaScript actions are going to leverage the GitHub ToolKit for developing GitHub Actions.
This is an external library that we will install using
npm
which means that you will need Node.js installed.I find writing actions to be easier from a local environment vs trying to do everything right here in the repository. Doing these steps locally allows you to use the editor of your choice so that you have all the extensions and snippets you are used to when writing code.
If you do not have a preferred environment then I suggest following along with me exactly as you see on the screen, which means you'll need to install Visual Studio Code.
Don't forget to set up your workstation 😉
Most of your work going forward will take place away from your Learning Lab repository, so before continuing with the course ensure you have the following installed on your local machine.
:keyboard: Activity: Initialize a new JavaScript project
Once you have the necessary tools installed locally, follow these steps to begin creating your first action.
Open the Terminal (Mac and Linux) or Command Prompt (Windows) on your local machine
Clone your Learning Lab repo to your local machine:
Navigate to the folder you just cloned:
Create a new branch named
hello-world
. This is the branch we will use to write our first action. Please do not capitalize letters unless I do, I run case-sensitive checks to make sure I can help you along the way!Create a new folder for our actions files:
Navigate to the
hello-world
folder you just created:Initialize a new project:
Install the core dependency from the GitHub ToolKit:
Commit those newly added files,we will remove the need to upload node_modules in a later step:
Push your changes to your repository:
I will respond once you have finished.