Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit ad23a21

Browse files
committed
adding final responses
1 parent 03ab621 commit ad23a21

File tree

5 files changed

+122
-1
lines changed

5 files changed

+122
-1
lines changed

config.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,4 +377,13 @@ steps:
377377
actions:
378378
- type: createIssue
379379
title: Last minute notes
380-
body: 16_using-ncc.md
380+
body: great-job.md
381+
- type: respond
382+
issue: Last minute notes
383+
with: 16_using-ncc.md
384+
- type: respond
385+
issue: Last minute notes
386+
with: 16_publishing.md
387+
- type: respond
388+
issue: Last minute notes
389+
with: 16_complete.md

responses/16_complete.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## The End 😭
2+
3+
It was so fun having you as a student while taking this course. I'll forever cherish our time together {{user.login}}
4+
5+
You can keep this repository forever to remember our time... I actually encourage you to do so! This has now become your central point for notes on writing JavaScript Actions 😄
6+
7+
I really do think of everything!
8+
9+
Make sure to visit [Learning Lab](lab.github.com) for more courses on GitHub Actions and other awesome tech content.
10+
11+
We would love to hear what you thought about this course, share your experience with us and others in the [Community forum](https://github.51.almunity/t5/GitHub-Learning-Lab/bd-p/learn)
12+
13+
---
14+
15+
To fully complete your course **close this issue**

responses/16_publishing.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Publishing your Actions
2+
3+
Publishing your Actions is a great way to help others in your team and across the GitHub community. Although Actions do not need to be published to be consumed by adding them to the marketplace you make them easier to find.
4+
5+
Some notable Actions you will find on the marketplace are:
6+
7+
- [Actions for Discord](https://github.com/marketplace/actions/actions-for-discord)
8+
- [GitHub Action for Slack](https://github.com/marketplace/actions/github-action-for-slack)
9+
- [Jekyll Action](https://github.com/marketplace/actions/jekyll-action)
10+
- [Run Jest](https://github.com/marketplace/actions/run-jest)
11+
12+
And that just scratches the surface of the 1600+ and counting Actions you will find on the marketplace 😄
13+
14+
📖Follow [this guide](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/publishing-actions-in-github-marketplace#publishing-an-action) to learn how to publish your Actions to the GitHub Marketplace

responses/16_using-ncc.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## Getting rid of node_modules
2+
3+
We typically don't commit a `node_modules` folder in a repository. These can often grow to be huge if your project has many dependencies. Because of the way Node works this folder is a necessary evil, but there is a way to get rid of it!
4+
5+
First you need to install a tool called [ncc](https://github.com/zeit/ncc). You'll want to install this tool globally so that you can use as if it's any other CLI tool on your machine.
6+
7+
What **ncc** does is take all the dependencies within your project and compile them into a single JavaScript file. This allows you to avoid committing the `node_modules` folder in your Actions source code.
8+
9+
**Install ncc**
10+
`npm install -g @zeit/ncc`
11+
12+
**Using ncc**
13+
When you use ncc:
14+
15+
`ncc build <input-file>`
16+
17+
A new directory named `dist` will be created. Within that directory you will find a file named `index.js`. To tell GitHub Actions that this new `index.js` file is the one that should run when your Action is used a small edit to the `action.yml` file needs to be made.
18+
19+
_before:_
20+
21+
```yaml
22+
runs:
23+
using: "node12"
24+
main: "index.js"
25+
```
26+
27+
_after:_
28+
29+
```yaml
30+
runs:
31+
using: "node12"
32+
main: "dist/index.js"
33+
```
34+
35+
Once you make this change you can delete the `node_modules` folder and commit those changes to the repository that contains your Actions source code.
36+
37+
---
38+
39+
📖Further help [using ncc](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-a-javascript-action#commit-and-push-your-action-to-github) is in the GitHub Actions documentation.

responses/great-job.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Great job!
2+
3+
You did it 🎉
4+
5+
You have successfully written three different JavaScript Actions.
6+
7+
Let's take a quick look at all the things you learned in this course:
8+
9+
**Workflows**
10+
Along the way you learned a little about workflows and how to configure them. You managed to accomplish all these things:
11+
12+
- Define two different event triggers
13+
- Filter an event trigger to run only when a label is added to a pull request
14+
- You configured one unique job containing three unique steps within a workflow
15+
- You learned how to overwrite default Action values by defining them in a workflow
16+
- One of your steps consumed a secret
17+
- One of your steps consumed the output of a previous step
18+
19+
That's quite a bit for a course that doesn't cover workflows!
20+
21+
**Action metadata**
22+
23+
- You became familiar with over 1/2 of the syntax keywords that can be used in an `action.yml` file
24+
- Using `inputs:` and `outputs:` allowed you to create more dynamic and reusable metadata files for your Actions.
25+
- You've mow written the metadata for three different Actions
26+
27+
**JavaScript Actions**
28+
Wow, what a series of tasks! You started with the traditional `hello world` in the console, which was then expanded to use the `input:` parameters specified in the Actions metadata. Through the use of that metadata you were able to be flexible with your greeting.
29+
30+
You learned how GitHub Actions behave when consuming external APIs and you also used the response from an external API as an `output:` parameter for a later step in the workflow.
31+
32+
Lastly you saw how to use Actions to interact with a repository by creating an issue containing a joke.
33+
34+
You used multiple packages in your Action source code, you consumed `inputs:` and set `outputs:`.
35+
36+
You learned how to use the `@actions/core` package to write errors and terminate a misbehaving Action.
37+
38+
At this point you are armed with everything you need to know to go out there and begin creating your own custom JavaScript Actions.
39+
40+
### We aren't done yet 😉
41+
42+
Throughout this course I have promised to show you how to get rid of the `node_modules` folder in your repository.
43+
44+
I also want to take a few minutes to point you to the information you need to place your own custom Actions on the [GitHub Marketplace](https://github.com/marketplace?type=actions) for others to use.

0 commit comments

Comments
 (0)