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

Commit 26e001f

Browse files
committed
add a before step
1 parent f101a33 commit 26e001f

3 files changed

Lines changed: 74 additions & 2 deletions

File tree

config.yml

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,70 @@ steps:
6161
```
6262
position: 13
6363

64-
# 3. Point to the template repo
65-
# 4. Give the learner's repo a name
64+
# 3
65+
- title: Point to the template repo
66+
description: Point to the template repo
67+
event: pull_request.synchronize
68+
actions:
69+
- type: respond
70+
with: add-repo-name.md
71+
- type: octokit
72+
method: pullRequests.createComment
73+
owner: '%payload.repository.owner.login%'
74+
repo: '%payload.repository.name%'
75+
number: '%payload.number%'
76+
commit_id: '%payload.pull_request.head.sha%'
77+
path: config.yml
78+
body: |
79+
```suggestion
80+
name: my-sparkles-repo
81+
```
82+
position: 12
83+
84+
# 4
85+
- title: Give the learner's repo a name
86+
description: Give the learner's repo a name
87+
event: pull_request.synchronize
88+
actions:
89+
- type: respond
90+
with: create-issue.md
91+
- type: octokit
92+
method: pullRequests.createComment
93+
owner: '%payload.repository.owner.login%'
94+
repo: '%payload.repository.name%'
95+
number: '%payload.number%'
96+
commit_id: '%payload.pull_request.head.sha%'
97+
path: config.yml
98+
body: |
99+
```suggestion
100+
- type: createIssue
101+
```
102+
position: 22
103+
- type: octokit
104+
method: pullRequests.createComment
105+
owner: '%payload.repository.owner.login%'
106+
repo: '%payload.repository.name%'
107+
number: '%payload.number%'
108+
commit_id: '%payload.pull_request.head.sha%'
109+
path: config.yml
110+
body: |
111+
```suggestion
112+
title: Welcome
113+
```
114+
position: 23
115+
- type: octokit
116+
method: pullRequests.createComment
117+
owner: '%payload.repository.owner.login%'
118+
repo: '%payload.repository.name%'
119+
number: '%payload.number%'
120+
commit_id: '%payload.pull_request.head.sha%'
121+
path: config.yml
122+
body: |
123+
```suggestion
124+
body: welcome-text.md
125+
```
126+
position: 24
127+
66128
# 5. Create an issue using Learning Lab
67129
# 6. Create your first response
68130
# 7. Name your first step and give it a description

responses/add-repo-name.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Awesome! The learner's repo will now be cloned from `lab-starter-template`. We probably don't want that to be the learner's repo name though, so let's ensure that the learner-facing name is better.
2+
3+
Change the field `name:` as part of the `template:` section to anything you like. You can also accept the suggestion below.

responses/create-issue.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Great! Now let's work on the `before:` block. Anything in this block will occur before the learner gets access to the repo Learning Lab will create for them.
2+
3+
We'll use the `createIssue` action to create an issue for the learner with some initial instructions. The `createIssue` action requires two options:
4+
- a title
5+
- the body of the response
6+
7+
We'll define both of those here, but we'll create the body in the next step. You can edit the file manually or accept the suggested changes below. Since there are multiple suggested changes, you can go to the "Files changed tab" and accept them as a batch.

0 commit comments

Comments
 (0)