|
4 | 4 |
|
5 | 5 | This is an external library that we will install using `npm` which means that you will need [Node.js](https://nodejs.org/) installed. |
6 | 6 |
|
7 | | -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. |
| 7 | +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. |
8 | 8 |
|
9 | 9 | 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](https://code.visualstudio.com/). |
10 | 10 |
|
11 | 11 | ## Don't forget to set up your workstation 😉 |
12 | 12 |
|
13 | | -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**. |
| 13 | +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**. |
14 | 14 |
|
15 | 15 | 1. [ ] [Node.js](https://nodejs.org) |
16 | 16 | 2. [ ] [Visual Studio Code](https://code.visualstudio.com/) or your editor of choice |
17 | 17 | 3. [ ] [Git](https://git-scm.com/) |
18 | 18 |
|
19 | | - |
20 | 19 | ### :keyboard: Activity: Configure your environment |
21 | 20 |
|
22 | 21 | Now that you have all the necessary tools installed locally, follow these steps to ensure your environment is configured and ready for Actions. |
23 | 22 |
|
24 | 23 | 1. Open the **Terminal** (Mac and Linux) or **Command Prompt** (Windows) on your local machine |
25 | 24 | 2. Clone your Learning Lab repo to your local machine: |
26 | 25 | `git clone {{repoUrl}}.git` |
| 26 | + |
27 | 27 | <details><summary>View GIF</summary><img src="https://media.giphy.com/media/YnvmISGo2MbXpn2bc5/giphy.gif" alt="git clone example" /></details> |
28 | 28 | <!--  --> |
29 | 29 |
|
30 | 30 | 3. Navigate to the folder you just cloned: |
31 | 31 | `cd writing-javascript-actions` |
32 | 32 | <details><summary>View GIF</summary><img src="https://media.giphy.com/media/duA6JVCuXbt5gKqNLw/giphy.gif" alt="directory navigation" /></details> |
33 | 33 | <!--  --> |
34 | | -4. 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!** |
| 34 | +4. 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!** |
35 | 35 | `git checkout -b hello-world` |
| 36 | + |
36 | 37 | <details><summary>View GIF</summary><img src="https://media.giphy.com/media/hvdeWGkjoy4UdfwbfQ/giphy.gif" alt="git checkout example" /></details> |
37 | | - |
| 38 | + |
38 | 39 | 5. Create a new folder for our Actions files: |
39 | 40 | `mkdir -p .github/actions/hello-world` |
40 | 41 | <details><summary>View GIF</summary><img src="https://media.giphy.com/media/Wn03sc0QsywHHD1LeN/giphy.gif" alt="create folder for action example" /></details> |
41 | 42 | 6. Navigate to the `hello-world` folder you just created: |
42 | 43 | `cd .github/actions/hello-world` |
| 44 | + |
43 | 45 | <details><summary>View GIF</summary><img src="https://media.giphy.com/media/ckCMgczjpbjNwkfJq4/giphy.gif" alt="navigate to folder for action example" /></details> |
44 | | - |
| 46 | + |
45 | 47 | 7. Initialize a new project: |
46 | 48 | `npm init -y` |
| 49 | + |
47 | 50 | <details><summary>View GIF</summary><img src="https://media.giphy.com/media/mEW0fJYx4oUjdgYHDV/giphy.gif" alt="navigate to folder for action example" /></details> |
48 | 51 |
|
49 | | -8. Install the **core** and **github** dependencies from the [GitHub ToolKit](https://github.com/actions/toolkit): |
50 | | - `npm install --save @actions/core @actions/github` |
| 52 | +8. Install the **core** dependency from the [GitHub ToolKit](https://github.com/actions/toolkit): |
| 53 | + `npm install --save @actions/core` |
51 | 54 | <details><summary>View GIF</summary><img src="https://media.giphy.com/media/H3kGNqDI24lNOEKk5k/giphy.gif" alt="navigate to folder for action example" /></details> |
52 | | -9. Commit those newly added files,we will remove the need to upload **node_modules** in a later step: |
53 | | - `git add .` |
54 | | - `git commit -m 'initial hello-world'` |
| 55 | +9. Commit those newly added files,we will remove the need to upload **node_modules** in a later step: |
| 56 | + `git add .` |
| 57 | + `git commit -m 'initial hello-world'` |
55 | 58 | 10. Push you changes to your repository: |
56 | 59 | `git push -u origin hello-world` |
57 | 60 |
|
58 | | - |
59 | 61 | --- |
60 | 62 |
|
61 | 63 | I will respond once you have finished. |
62 | | - |
63 | | - |
64 | | - |
0 commit comments