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

Commit a347553

Browse files
authored
Merge pull request #12 from githubtraining/briana-edits
Standardize responses
2 parents 090d929 + cdc6849 commit a347553

46 files changed

Lines changed: 305 additions & 199 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config.yml

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,28 @@ template:
77
before:
88
- type: createIssue
99
title: Welcome
10-
body: welcome.md
10+
body: 00.0_welcome.md
1111
data:
1212
prUrl: '%payload.repository.html_url%/compare/master...add-metadata?expand=1'
13+
- type: updateBranchProtection
14+
1315
steps:
1416

1517
# 1
1618
- title: Open a PR to begin crafting your course
1719
description: Open a PR to begin crafting your course
1820
event: pull_request.opened
21+
link: '{{ repoUrl }}/issues/1'
1922
actions:
2023
- type: gate
2124
left: '%payload.pull_request.head.ref%'
2225
operator: ===
2326
right: add-metadata
2427
else:
2528
- type: respond
26-
with: e-branch.md
29+
with: 01.1_e-branch.md
2730
- type: respond
28-
with: add-title.md
31+
with: 01.0_add-title.md
2932
- type: octokit
3033
method: pullRequests.createComment
3134
owner: '%payload.repository.owner.login%'
@@ -43,7 +46,7 @@ steps:
4346
- title: Give your course a title
4447
description: Give your course a title
4548
event: pull_request.synchronize
46-
actions:
49+
actions:
4750
- type: getFileContents
4851
action_id: fileContents
4952
filename: 'config.yml'
@@ -53,9 +56,9 @@ steps:
5356
right: '%actions.fileContents%'
5457
else:
5558
- type: respond
56-
with: e-no-title.md
59+
with: 02.1_e-no-title.md
5760
- type: respond
58-
with: add-template.md
61+
with: 02.0_add-template.md
5962
- type: octokit
6063
method: pullRequests.createComment
6164
owner: '%payload.repository.owner.login%'
@@ -83,9 +86,9 @@ steps:
8386
right: '%actions.fileContents%'
8487
else:
8588
- type: respond
86-
with: e-no-repo.md
89+
with: 03.1_e-no-repo.md
8790
- type: respond
88-
with: add-repo-name.md
91+
with: 03.0_add-repo-name.md
8992
- type: octokit
9093
method: pullRequests.createComment
9194
owner: '%payload.repository.owner.login%'
@@ -113,9 +116,9 @@ steps:
113116
right: '%actions.fileContents%'
114117
else:
115118
- type: respond
116-
with: e-no-name.md
119+
with: 04.1_e-no-name.md
117120
- type: respond
118-
with: create-issue.md
121+
with: 04.0_create-issue.md
119122
- type: octokit
120123
method: pullRequests.createComment
121124
owner: '%payload.repository.owner.login%'
@@ -157,7 +160,7 @@ steps:
157160
- title: Create an issue using Learning Lab
158161
description: Create an issue using Learning Lab
159162
event: pull_request.synchronize
160-
actions:
163+
actions:
161164
- type: getFileContents
162165
action_id: fileContents
163166
filename: 'config.yml'
@@ -167,9 +170,11 @@ steps:
167170
right: '%actions.fileContents%'
168171
else:
169172
- type: respond
170-
with: e-no-new-issue.md
173+
with: 05.1_e-no-new-issue.md
171174
- type: respond
172-
with: add-response.md
175+
with: 05.0_add-response.md
176+
data:
177+
fileUrl: '%payload.repository.html_url%/new/add-metadata/responses?filename=responses/welcome-text.md'
173178

174179
# 6
175180
- title: Create your first response
@@ -186,7 +191,7 @@ steps:
186191
right: path:responses/welcome-text.md
187192
else:
188193
type: respond
189-
with: e-no-response.md
194+
with: 06.1_e-no-response.md
190195
- type: getFileContents
191196
action_id: fileContents
192197
filename: 'responses/welcome-text.md'
@@ -196,9 +201,9 @@ steps:
196201
right: '%actions.fileContents%'
197202
else:
198203
- type: respond
199-
with: e-no-response.md
204+
with: 06.1_e-no-response.md
200205
- type: respond
201-
with: add-first-step.md
206+
with: 06.0_add-first-step.md
202207
- type: octokit
203208
method: pullRequests.createComment
204209
owner: '%payload.repository.owner.login%'
@@ -238,9 +243,9 @@ steps:
238243
right: '%actions.fileContents%'
239244
else:
240245
- type: respond
241-
with: e-no-step-title.md
246+
with: 07.1_e-no-step-title.md
242247
- type: respond
243-
with: add-trigger.md
248+
with: 07.0_add-trigger.md
244249
- type: octokit
245250
method: pullRequests.createComment
246251
owner: '%payload.repository.owner.login%'
@@ -268,9 +273,9 @@ steps:
268273
right: '%actions.fileContents%'
269274
else:
270275
- type: respond
271-
with: e-no-event.md
276+
with: 08.1_e-no-event.md
272277
- type: respond
273-
with: validate.md
278+
with: 08.0_validate.md
274279
- type: octokit
275280
method: pullRequests.createComment
276281
owner: '%payload.repository.owner.login%'
@@ -298,9 +303,9 @@ steps:
298303
right: '%actions.fileContents%'
299304
else:
300305
- type: respond
301-
with: e-no-gate.md
306+
with: 09.1_e-no-gate.md
302307
- type: respond
303-
with: add-context.md
308+
with: 09.0_add-context.md
304309
- type: octokit
305310
method: pullRequests.createComment
306311
owner: '%payload.repository.owner.login%'
@@ -352,9 +357,11 @@ steps:
352357
# right: '%actions.fileContents%'
353358
# else:
354359
# - type: respond
355-
# with: e-no-gate-options.md
360+
# with: 10.1_e-no-gate-options.md
356361
- type: respond
357-
with: respond-success.md
362+
with: 10.0_respond-success.md
363+
data:
364+
fileUrl: '%payload.repository.html_url%/blob/add-metadata/responses/pr-opened.md'
358365
- type: octokit
359366
method: pullRequests.createComment
360367
owner: '%payload.repository.owner.login%'
@@ -394,9 +401,9 @@ steps:
394401
right: '%actions.fileContents%'
395402
else:
396403
- type: respond
397-
with: e-no-respond-action.md
404+
with: 11.1_e-no-respond-action.md
398405
- type: respond
399-
with: add-descriptions.md
406+
with: 11.0_add-descriptions.md
400407
- type: octokit
401408
method: pullRequests.createComment
402409
owner: '%payload.repository.owner.login%'
@@ -418,7 +425,7 @@ steps:
418425
path: config.yml
419426
body: |
420427
```suggestion
421-
description: Go from 0 to PR 1 in less than 10 minutes with this course.
428+
description: Go from 0 to PR 1 in less than 10 minutes with this course.
422429
```
423430
position: 8
424431

@@ -436,9 +443,11 @@ steps:
436443
right: '%actions.fileContents%'
437444
else:
438445
- type: respond
439-
with: e-no-meta.md
446+
with: 12.1_e-no-meta.md
440447
- type: respond
441-
with: add-readme.md
448+
with: 12.0_add-readme.md
449+
data:
450+
fileUrl: '%payload.repository.html_url%/edit/add-metadata/README.md'
442451

443452
# 13
444453
- title: Add a README to your course
@@ -455,15 +464,15 @@ steps:
455464
right: path:README.md
456465
else:
457466
type: respond
458-
with: e-no-readme.md
459-
- type: respond
460-
with: publish.md
467+
with: 13.1_e-no-readme.md
468+
- type: createReview
469+
body: 13.0_publish.md
470+
event: APPROVE
461471

462472
# 14
463473
- title: Publish your course to the sandbox environment
464474
description: Publish your course to the sandbox environment
465475
event: pull_request.closed
466-
actions:
476+
actions:
467477
- type: respond
468-
with: congratulations.md
469-
478+
with: 14.0_congratulations.md

responses/00.0_welcome.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Welcome!
2+
3+
:running_woman: If you look around this repository, you'll find a few standard template files in your Code tab. These contain most of what you need to get a Learning Lab course up and running. You can take this code as-is and create a Learning Lab course on your own. If you'd like some guidance, continue taking this course!
4+
5+
:book: The official [Learning Lab docs](https://github.github.com/learning-lab-equipment/#/) contain full instructions on how to create courses. We'll link to the docs throughout the course. Take a look if you'd like more information about steps we take in this course.
6+
7+
### New to GitHub?
8+
9+
For this course, you'll need to know how to create a branch on GitHub, commit changes using Git, and open a pull request on GitHub. If you need a refresher on the GitHub flow, check out [the Introduction to GitHub course]({{ host}}/courses/introduction-to-github).
10+
11+
You'll also need a general understanding of webhooks and the GitHub API. [The Getting started with GitHub Apps course]({{ host}}/courses/getting-started-with-github-apps) is a good place to start.
12+
13+
## Step 1: Open a pull request
14+
15+
The first step for creating a Learning Lab course is to have a `config.yml` file. We've gotten one started for you in the `add-metadata` branch.
16+
17+
### :keyboard: Activity: Open a pull request
18+
19+
1. [Open a pull request]({{ prUrl }}) with base `master`, and comparing the `add-metadata` branch.
20+
21+
<hr>
22+
<h3 align="center">I'll respond in your new pull request with your next step.</h3>

responses/01.0_add-title.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Great! In the next couple of steps we'll [:book: Set up the course](https://github.github.com/learning-lab-equipment/#/3-4-yaml?id=set-up-the-course).
2+
3+
## Step 2: Name your course
4+
5+
Now, let's give your course a title.
6+
7+
### :keyboard: Activity: Give your course a title
8+
9+
1. Replace the commented "title" field on near the metadata section of the `config.yml` file with a title for your first course
10+
- Note: You can do this by editing the file, or accepting my suggested change
11+
12+
<hr>
13+
<h3 align="center">I'll respond below when I detect a commit on this branch.</h3>

responses/01.1_e-branch.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
You opened a pull request, but not against the branch I expected. Open a pull with base as `master` and compare as `add-metadata`.
2+
3+
<hr>
4+
<h3 align="center">I'll respond in your new pull request.</h3>

responses/02.0_add-template.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Great! The title will appear anywhere the course is referenced. We'll fill in some more of the course metadata later. First, let's get into its foundation.
2+
3+
### Template Repositories
4+
Most courses make use of a [:book: template repository](https://github.github.com/learning-lab-equipment/#/2-4-template). Template repositories are cloned for the learner and can contain starter code or resources to help them find their way.
5+
6+
When creating or choosing a template repository for your course, consider two main points.
7+
8+
First, how will this content help teach the concept? For example, if a course is teaching HTML, the success of the finished product should feature HTML.
9+
10+
Second, is the finished product useful? At the end of the course, the finished repository should serve a purpose aside from the lessons. A working game, a portfolio or resume, or a collection of template documents are a few examples.
11+
12+
## Step 3: Designate a template repository
13+
Let's add our own template repository. To speed things up, we've created a template repository for you. We recommend using our template for this course.
14+
15+
### :keyboard: Activity: Add a template repository
16+
17+
1. Replace the commented `repo:` under `template:` in the `config.yml` file with a title of your first course
18+
- Note: You can do this by editing the file, or accepting my suggested change
19+
20+
<hr>
21+
<h3 align="center">I'll respond below when I detect a commit on this branch.</h3>
File renamed without changes.

responses/03.0_add-repo-name.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Awesome! Whenever a user registers for this course, Learning Lab will create a new repository for them based on `lab-starter-template`.
2+
3+
## Step 4: Name the repository
4+
5+
`lab-starter-template` is a great template repository, and it's named to reflect that. But, we want the user to experience that repository through a _different_ name. We can designate that name in the `config.yml`.
6+
7+
### :keyboard: Activity: Update the repository name
8+
9+
1. Change the field `name:` as part of the `template:` section to anything you like
10+
- Note: You can do this by editing the file, or accepting my suggested change
11+
12+
<hr>
13+
<h3 align="center">I'll respond below when I detect a commit on this branch.</h3>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
I didn't detect a repo name.
1+
I didn't detect a repository name.
22

33
<hr>
44
<h3 align="center">When I detect your new commit, I'll respond in this pull request.</h3>

responses/04.0_create-issue.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Great! Now let's work on the `before:` block.
2+
3+
### `before:`
4+
Anything in this block occurs before the learner can access their course repository.
5+
6+
### Learning Lab actions
7+
Actions are reusable modules that each course has access to. They are each designed to do very specific things, and nothing more. This is to optimize for reusability and simplicity. The documentation contains a listing of [:book: all available actions](https://github.github.com/learning-lab-equipment/#/actions/).
8+
9+
## Step 5: Add to the `before` block
10+
11+
We'll use the [:book: `createIssue` action](https://github.github.com/learning-lab-equipment/#/actions/createIssue/) to create an issue for the learner with some initial instructions. The `createIssue` action requires two [:book: options](https://github.github.com/learning-lab-equipment/#/actions/createIssue/?id=options):
12+
- a title
13+
- the body of the response
14+
15+
We'll define both of those here, but we'll create the body in the next step.
16+
17+
### :keyboard: Activity: Add the `createIssue` action
18+
19+
1. Add a `createIssue` action in the `before:` block
20+
- Note: Since there are multiple suggested changes, you can go to the "Files changed" tab and [accept them as a batch](https://help.github.com/articles/incorporating-feedback-in-your-pull-request/)
21+
22+
<hr>
23+
<h3 align="center">I'll respond below when I detect a commit on this branch.</h3>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
You didn't include a response. Try again.
1+
You didn't name the learner's repository.
22

33
<hr>
44
<h3 align="center">When I detect your new commit, I'll respond in this pull request.</h3>

0 commit comments

Comments
 (0)