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

Commit bb21a2d

Browse files
authored
Merge pull request #6 from githubtraining/error-handling
Error handling
2 parents ca36621 + 637a8cd commit bb21a2d

29 files changed

+889
-327
lines changed

config.yml

Lines changed: 490 additions & 79 deletions
Large diffs are not rendered by default.

course-details.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[GitHub Actions](https://github.com/features/actions) is a powerful platform that empowers your team to go from code to cloud all from the comfort of your own repositories.
22

3-
Over the duration of this course, approximately 1 hour, you will learn the skills needed to begin using and customizing GitHub Actions to fit your unique workflow scenarios.
3+
Over the duration of this course you will learn the skills needed to begin using and customizing GitHub Actions to fit your unique workflow scenarios.
44

55
## What you'll learn
66

responses/01_explain-syntax.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Go on... Tell me more!
22

3-
I'm glad you asked. Let's take a look at the workflow file that we just committed to this repository.
3+
I'm glad you asked. Let's take a look at a workflow file similar to what we just committed to this repository.
44

55
```yaml
66
name: CI
@@ -52,3 +52,5 @@ Let's take a second to talk about each of the pieces that we see here:
5252

5353
📖Take a deeper dive into [workflow components](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-workflows)
5454
📖Read more about [configuring workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/configuring-workflows)
55+
56+
*if you don't see a response from me below this, try making a new commit to this branch. Your workflow may have finished before I was ready to listen*

responses/01_welcome-activity.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ _In our case, we will use this one **workflow** file for many things, which lead
1212

1313
### :keyboard: Activity: Create a pull request to prepare the repository for actions
1414

15-
1. Create a new workflow file titled `my-workflow.yml` by using the instructions below, or [this quicklink]({{quicklink}}).
15+
1. Create a new workflow file titled `my-workflow.yml` inside of the folders `.github/workflows/` by using the instructions below, or [this quicklink]({{quicklink}}).
1616
- Go to the [Actions tab]({{ actionsUrl }}).
1717
- Choose the **Set up a workflow yourself** option, located on the top right hand corner of the screen.
18-
- Change the name of the file from `main.yml` to `my-workflow.yml`.
19-
1. Commit the workflow to a new branch named `add-initial-workflow`.
20-
1. Create a pull request titled **Create my-workflow.yml**.
18+
- Change the name of the file to `.github/workflows/my-workflow.yml`.
19+
1. Commit the workflow to a new branch, you can name it `add-initial-workflow`.
20+
1. Create a pull request titled **Create a workflow**.
2121
1. Supply the pull request body content and click `Create pull request`.
2222

2323
_It is important to place meaningful content into the body of the pull requests you create throughout this course. This repository will stay with you long after you complete the course. It is advisable that you use the body of the pull requests you create as a way to take long lived notes about thing you want to remember._

responses/02_modify-workflow.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,23 @@ Currently `my-workflow.yml` is not set up correctly for our use-case. It worked
44

55
### :keyboard: Activity: Modify my-workflow.yml to remove boilerplate steps
66

7-
1. [Edit]({{workflowFile}}) the `my-workflow.yml`.
8-
2. Change the `name:` property located of `my-workflow.yml` to `JS Actions`
9-
3. Rename the job from `build` to `action`
10-
4. Remove the two steps that run commands, but leave the step that runs the checkout action.
11-
5. Commit these file changes to this branch
7+
1. [Edit]({{workflowFile}}) the `my-workflow.yml` to have the following contents:
8+
```yaml
9+
name: JS Actions
1210

13-
I'll respond in this pull request once you make these changes.
14-
15-
---
11+
on: [push]
1612

17-
<details><summary>The complete workflow can be viewed by clicking here</summary>
13+
jobs:
14+
action:
15+
runs-on: ubuntu-latest
1816

19-
```yaml
20-
name: JS Actions
17+
steps:
18+
- uses: actions/checkout@v1
19+
```
20+
2. Commit these file changes to this branch
2121
22-
on: [push]
22+
---
2323
24-
jobs:
25-
action:
26-
runs-on: ubuntu-latest
24+
I'll respond in this pull request once you make these changes.
2725
28-
steps:
29-
- uses: actions/checkout@v1
30-
```
3126
32-
</details>

responses/03_reference-actions.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,25 @@ If you'd like to see more examples of workflows and actions then check out these
2323

2424
### :keyboard: Activity: Modify my-workflow.yml to run our custom action
2525

26-
1. [Edit]({{workflowFile}}) the `my-workflow.yml`.
27-
1. Add a new `step:` and `name:` it `hello-action`
28-
1. Set the value of `uses:` to `./.github/actions/hello-world`
29-
1. Commit these file changes to this branch
30-
31-
---
26+
1. [Edit]({{workflowFile}}) the `my-workflow.yml` to contain the following:
27+
```yaml
28+
name: JS Actions
3229

33-
<details><summary>The complete workflow can be viewed by clicking here</summary>
30+
on: [push]
3431

35-
```yaml
36-
name: JS Actions
32+
jobs:
33+
action:
3734

38-
on: [push]
35+
runs-on: ubuntu-latest
3936

40-
jobs:
41-
action:
37+
steps:
38+
- uses: actions/checkout@v1
4239

43-
runs-on: ubuntu-latest
40+
- name: hello-action
41+
uses: ./.github/actions/hello-world
42+
```
43+
1. Commit these file changes to this branch
4444
45-
steps:
46-
- uses: actions/checkout@v1
45+
---
4746
48-
- name: hello-action
49-
uses: ./.github/actions/hello-world
50-
```
51-
</details>
47+
I'll respond when I notice you've made these changes

responses/05_create-metadata.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Now that we know what action metadata is, let's create the metadata for our curr
88

99
We will start with using the parameters that are **required** and later implement some optional parameters as our action evolves.
1010

11-
1. Create and add the following contents to the `.github/actions/hello-world/action.yml` file:
11+
1. Create a new file in: `.github/actions/hello-world/action.yml`
12+
1. Add the following contents to the `.github/actions/hello-world/action.yml` file:
1213
```yaml
1314
name: "my hello action"
1415

@@ -19,11 +20,12 @@ We will start with using the parameters that are **required** and later implemen
1920
main: "main.js"
2021
```
2122
2. Save the `action.yml` file
22-
3. Commit the changes:
23-
`git add action.yml`
24-
`git commit -m 'create action.yml'`
25-
4. Push them to the `hello-world` branch:
26-
`git push`
23+
3. Commit the changes and push them to the `hello-world` branch:
24+
```shell
25+
git add action.yml
26+
git commit -m 'create action.yml'
27+
git push
28+
```
2729

2830
---
2931

responses/06_main-js.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ The first iteration of our action will follow the traditional path of logging "H
2121
```
2222

2323
1. Save the `main.js` file
24-
1. Commit the changes:
25-
`git add main.js`
26-
`git commit -m 'create main.js'`
27-
1. Push them to the `hello-world` branch:
28-
`git push`
24+
1. Commit the changes and push them to the `hello-world` branch:
25+
```shell
26+
git add main.js
27+
git commit -m 'create main.js'
28+
git push
29+
```
2930

3031
---
3132

responses/07_update-files.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,24 @@ That was a lot of information that you just learned. @{{user.login}} it is time
7676
</details>
7777
7878
2. Save the changes to each file
79-
3. Commit the changes to this branch
80-
`git add main.js action.yml workflow.yml`
81-
`git commit -m 'allow input in all action files'`
82-
4. Push the changes from your local machine to this repository.
83-
`git push`
79+
3. Commit the changes to this branch and push them to GitHub:
80+
81+
```shell
82+
git add main.js action.yml workflow.yml
83+
git commit -m 'allow input in all action files'
84+
git push
85+
```
8486

8587
---
8688

87-
I'll respond here when you finish this step.
89+
I'll respond here when GitHub Actions reports it's finished.
90+
91+
<details><summary>Is your workflow failing?</summary>
92+
93+
If you workflow is failing, please double check your:
94+
- JavaScript source code
95+
- action metadata
96+
- workflow file
97+
98+
Look for linter errors or any errors reported on the Actions tab. I will respond when I receive another workflow run is completed.
99+
</details>

responses/09_new-action.md

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,32 @@ Before we continue we are going to need to do a few things. First and foremost o
55
### :keyboard: Activity: Setting up the next action
66

77
1. [Edit]({{workflowFile}}) your workflow file by commenting out every single line. _(To comment in `.yml`, add a `#` symbol to the beginning of every line)_.
8-
2. Commit the changes to a new branch and name it `action-two`.
9-
3. Create a pull request named **External APIs**
10-
4. Supply the pull request with body content. Remember, this area can be used a notes later.
11-
5. Click `Create pull request`.
12-
13-
You will still see the workflow trying to execute with every push if you look at the [Actions tab]({{actionsUrl}}), however it will seem as though it fails. This is because there is a workflow file in the `.github/workflows` directory. The failure isn't actually a failure either, if you expand it you will see that there is simple no triggers for that given workflow and therefore it doesn't run. I have placed a screenshot below so you can become familiar with what this error looks like without the need to go to your [Actions tab]({{actionsUrl}}).
8+
```yaml
9+
# name: JS Actions
1410

15-
![No trigger screenshot](https://i.imgur.com/rARtXc1.png)
16-
Like our first action, I'll respond in the new pull request when I detect it has been opened.
11+
# on: [push]
1712

18-
---
13+
# jobs:
14+
# action:
1915

20-
<details><summary>The complete workflow can be viewed by clicking here</summary>
16+
# runs-on: ubuntu-latest
2117

22-
```yaml
23-
# name: JS Actions
18+
# steps:
19+
# - uses: actions/checkout@v1
2420

25-
# on: [push]
21+
# - name: hello-action
22+
# uses: ./.github/actions/hello-world
23+
```
24+
2. Commit the changes to a new branch, you can name it `action-two`.
25+
3. Create a pull request named **External APIs**
26+
4. Supply the pull request with body content. Remember, this area can be used a notes later.
27+
5. Click `Create pull request`.
2628

27-
# jobs:
28-
# action:
29+
You will still see the workflow trying to execute with every push if you look at the [Actions tab]({{actionsUrl}}), however it will seem as though it fails. This is because there is a workflow file in the `.github/workflows` directory. The failure isn't actually a failure either, if you expand it you will see that there is simple no triggers for that given workflow and therefore it doesn't run. I have placed a screenshot below so you can become familiar with what this error looks like without the need to go to your [Actions tab]({{actionsUrl}}).
2930

30-
# runs-on: ubuntu-latest
31+
![No trigger screenshot](https://i.imgur.com/rARtXc1.png)
3132

32-
# steps:
33-
# - uses: actions/checkout@v1
3433

35-
# - name: hello-action
36-
# uses: ./.github/actions/hello-world
37-
```
34+
---
3835

39-
</details>
36+
Like our first action, I'll respond in the new pull request when I detect it has been opened.

0 commit comments

Comments
 (0)