You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-13Lines changed: 22 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,16 +39,20 @@ Write your own GitHub JavaScript Action and automate customized tasks unique to
39
39
40
40
</details>
41
41
42
-
43
42
<!--
44
43
<<< Author notes: Step 1 >>>
45
44
Choose 3-5 steps for your course.
46
45
The first step is always the hardest, so pick something easy!
47
46
Link to docs.github.com for further explanations.
48
47
Encourage users to open new tabs for steps!
49
-
TBD-step-1-notes.
50
48
-->
51
49
50
+
<detailsid=1>
51
+
52
+
<summary><h2> Step 1: Initialize a new JavaScript project</h2></summary>
53
+
54
+
_Welcome to the course :tada:_
55
+
52
56
### Configuring a workflow
53
57
54
58
Actions are enabled on your repository by default, but we still have to tell our repository to use them. We do this by creating a workflow file in our repository.
@@ -61,10 +65,6 @@ _In our case, we will use this one **workflow** file for many things, which lead
61
65
62
66
Read more about [workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-a-workflow#choosing-the-type-of-actions-for-your-workflow)
63
67
64
-
<detailsid=1>
65
-
66
-
<summary><h2> Step 1: Initialize a new JavaScript project</h2></summary>
67
-
68
68
## On to your development environment
69
69
70
70
Our JavaScript actions are going to leverage the [GitHub ToolKit](https://github.com/actions/toolkit) for developing GitHub Actions.
@@ -83,7 +83,7 @@ Most of your work going forward will take place away from your Skills repository
83
83
2.[ ][Visual Studio Code](https://code.visualstudio.com/) or your editor of choice
84
84
3.[ ][Git](https://git-scm.com/)
85
85
86
-
### Activity 1: Initialize a new JavaScript project
86
+
### :keyboard:Activity 1: Initialize a new JavaScript project
87
87
88
88
Once you have the necessary tools installed locally, follow these steps to begin creating your first action.
89
89
@@ -132,11 +132,13 @@ Once you have the necessary tools installed locally, follow these steps to begin
132
132
<details id=2>
133
133
<summary><h2> Step 2: Configure Your Action</h2></summary>
134
134
135
+
_Let's keep going! :bike:_
136
+
135
137
### Excellent!
136
138
137
139
Now that we have the custom action pre-requisites, let us create **joke-action** action.
138
140
139
-
### Activity 1: Configure Your Action
141
+
### :keyboard: Activity 1: Configure Your Action
140
142
141
143
All of the following steps take place inside of the `.github/actions/joke-action` directory.
142
144
@@ -168,6 +170,8 @@ We will start with using the parameters that are **required** and later implemen
168
170
<details id=3>
169
171
<summary><h2> Step 3: Create the metadata file</h2></summary>
170
172
173
+
_Nice working configuring your action :smile:_
174
+
171
175
## Action metadata
172
176
173
177
Every GitHub Action that we write needs to be accompanied by a metadata file. This file has a few rules to it, as are indicated below:
@@ -191,7 +195,7 @@ This file defines the following information about your action:
191
195
192
196
Read more about [Action metadata](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions)
193
197
194
-
### Activity 1: Create the metadata file
198
+
### :keyboard: Activity 1: Create the metadata file
195
199
196
200
All of the following steps take place inside of the `.github/actions/joke-action` directory.
197
201
@@ -226,6 +230,8 @@ Our action does not require much metadata for it to run correctly. We will not b
226
230
<details id=4>
227
231
<summary><h2> Step 4: Create the JavaScript files for your action</h2></summary>
228
232
233
+
_Good job adding the metadata file! :dancer:_
234
+
229
235
## Files
230
236
231
237
As you probably know, in JavaScript and other programming languages it is common to break your code into modules so that it is easier to read and maintain going forward. Since JavaScript actions are just programs written in JavaScript that run based on a specific trigger we are able to make our action code modular as well.
@@ -333,7 +339,7 @@ _Don't forget to call the `run()` function._
333
339
334
340
</details>
335
341
336
-
### Activity 1: Creating the JavaScript files for your new action.
342
+
### :keyboard: Activity 1: Creating the JavaScript files for your new action.
337
343
338
344
1. Create and add the following contents to the `.github/actions/joke-action/joke.js` file:
339
345
@@ -389,11 +395,11 @@ _Don't forget to call the `run()` function._
389
395
<details id=5>
390
396
<summary><h2> Step 5: Add your action to the workflow file</h2></summary>
391
397
392
-
### Great job!
398
+
_Great job! :tada:_
393
399
394
400
All of the following steps will add the action to the workflow file that’s already in the repo [`my-workflow.yml` file](/.github/workflows/my-workflow.yml)
395
401
396
-
### Activity 1: Edit the custom action at the bottom of the workflow file.
402
+
### :keyboard: Activity 1: Edit the custom action at the bottom of the workflow file.
397
403
398
404
```yaml
399
405
- name: ha-ha
@@ -429,7 +435,8 @@ You can make these changes in your repository by opening [`my-workflow.yml`](/.g
429
435
430
436
<summary><h2> Step 6: Trigger the joke action</h2></summary>
431
437
432
-
### Great job!
438
+
_Great job! :heart:_
439
+
433
440
Everything is all set up and now we are ready to start laughing. You will find you have some joke related labels available to you in this repository. You don't have to use them, any label will trigger our workflow, but the easiest way to follow along would be to use suggested labels.
434
441
435
442
### Trigger a joke
@@ -444,6 +451,8 @@ Everything is all set up and now we are ready to start laughing. You will find y
0 commit comments