Open github-learning-lab[bot] opened 2 years ago
Please ensure that on your hello-world
branch, you've taken the following steps:
# 1. Created a folder with the name: .github/actions/hello-world
mkdir -p .github/actions/hello-world
cd .github/actions/hello-world
# 2. Inside the new folder, initialized it as a Node.js project:
npm init -y
# 3. Installed the core dependency from the GitHub Actions Toolkit:
npm install --save @actions/core
# 4. Staged, committed, and pushed all the files that were generated as a result:
git add .
git commit -m 'initial hello-world'
git push -u origin hello-world
This will generate a number of files, but I'm spot checking that:
.github/actions/hello-world/package.json
"dependencies": {
"@actions/core": "^1.2.1"
}
On to your development environment
@chandanakk 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.