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

Commit 8e7f039

Browse files
committed
walk learner through adding their first step
1 parent 26e001f commit 8e7f039

5 files changed

Lines changed: 93 additions & 4 deletions

File tree

config.yml

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,84 @@ steps:
125125
```
126126
position: 24
127127

128-
# 5. Create an issue using Learning Lab
129-
# 6. Create your first response
130-
# 7. Name your first step and give it a description
131-
# 8. Trigger your first step with a GitHub event
128+
# 5
129+
- title: Create an issue using Learning Lab
130+
description: Create an issue using Learning Lab
131+
event: pull_request.sychronize
132+
actions:
133+
- type: respond
134+
with: add-response.md
135+
136+
# 6
137+
- title: Create your first response
138+
description: Create your first response
139+
event: pull_request.synchronize
140+
actions:
141+
- type: getTree
142+
action_id: tree
143+
recursive: true
144+
sha: '%payload.pull_request.head.sha%'
145+
- type: gate
146+
left: '%actions.tree.data.tree%'
147+
operator: includes
148+
right: path:responses/welcome-text.md
149+
else:
150+
type: respond
151+
with: e-no-response.md
152+
- type: respond
153+
with: add-first-step.md
154+
- type: octokit
155+
method: pullRequests.createComment
156+
owner: '%payload.repository.owner.login%'
157+
repo: '%payload.repository.name%'
158+
number: '%payload.number%'
159+
commit_id: '%payload.pull_request.head.sha%'
160+
path: config.yml
161+
body: |
162+
```suggestion
163+
- title: Create a new PR
164+
```
165+
position: 33
166+
- type: octokit
167+
method: pullRequests.createComment
168+
owner: '%payload.repository.owner.login%'
169+
repo: '%payload.repository.name%'
170+
number: '%payload.number%'
171+
commit_id: '%payload.pull_request.head.sha%'
172+
path: config.yml
173+
body: |
174+
```suggestion
175+
description: Add your name to the README.md file in your new PR
176+
```
177+
position: 34
178+
179+
# 7
180+
- title: Name your first step and give it a description
181+
description: Name your first step and give it a description
182+
event: pull_request.synchronize
183+
actions:
184+
- type: respond
185+
with: add-trigger.md
186+
- type: octokit
187+
method: pullRequests.createComment
188+
owner: '%payload.repository.owner.login%'
189+
repo: '%payload.repository.name%'
190+
number: '%payload.number%'
191+
commit_id: '%payload.pull_request.head.sha%'
192+
path: config.yml
193+
body: |
194+
```suggestion
195+
event: pull_request.opened
196+
```
197+
position: 35
198+
199+
# 8
200+
- title: Trigger your first step with a GitHub event
201+
description: Trigger your first step with a GitHub event
202+
event: pull_request.synchronize
203+
actions:
204+
- type: respond
205+
with: respond
132206
# 9. Respond to a learner's pull request
133207
# 10. Validate a learner's pull request
134208
# 11. Pass contextual information to a response

responses/add-first-step.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Great! The learner's repo will now be setup. Let's now dive into the `steps:`. This block is composed of steps that are triggered by `events` on GitHub, and in turn certain `actions` take place.
2+
3+
Note: `actions` in this context is NOT the same as GitHub Actions.
4+
5+
Let's name our first step.

responses/add-response.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Great, we referenced a file title `welcome-text.md`, but it doesn't exist. Learning Lab automatically looks in the `responses/` directory for all content files. Let's add it.
2+
3+
Activity: add a response
4+
5+
1. In the `/responses/` folder, create a new file titled `welcome-text.md`
6+
1. In that file, add some content that will appear to the learner in the welcome issue.

responses/add-trigger.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Great! Your learner now has information about what they're expected to do in this step of the course.
2+
3+
Let's now find the `event` that will trigger the step. Because we want the learner to open a new Pull Request, the event we're looking for is `pull_request.opened`.

responses/e-no-response.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
You didn't include a response. Try again.

0 commit comments

Comments
 (0)