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

Commit c719dcc

Browse files
committed
add remaining validations
1 parent ec26229 commit c719dcc

File tree

2 files changed

+47
-15
lines changed

2 files changed

+47
-15
lines changed

config.yml

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ template:
2626
# 4. (PR) Learner created PR, "Add issues to project board" possibly
2727
# secondPullNumber
2828
# secondPullUrl
29+
# 5. (Issue) Comment and triage with GitHub Script
30+
# thirdIssueUrl
31+
# thirdIssueNumber
32+
# 6. (PR) Learner created PR, "Create better comments" possibly
33+
# thirdPullNumber
34+
# thirdPullUrl
35+
# 7. (Issue) It's alive!
36+
# fourthIssueUrl
37+
# fourthIssueNumber
2938

3039
before:
3140
- type: updateBranchProtection
@@ -228,6 +237,18 @@ steps:
228237
event: pull_request.closed
229238
link: "{{ store.secondPullUrl }}"
230239
actions:
240+
- type: gate
241+
every: true
242+
gates:
243+
- left: '{{ payload.pull_request.number }}'
244+
operator: ===
245+
right: '{{ store.secondPullNumber }}'
246+
- left: '{{ payload.pull_request.merged }}'
247+
else:
248+
- type: respond
249+
with: e-generic.md
250+
data:
251+
expected: merge pull request '{{ store.secondPullNumber }}'
231252
- type: createIssue
232253
title: Comment and triage with GitHub Script
233254
body: 05_workflow-triggered.md
@@ -287,24 +308,14 @@ steps:
287308
- pull_request.edited
288309
link: "{{store.thirdPullUrl}}"
289310
actions:
290-
- type: gate
291-
store:
292-
thirdPullNumber: "%payload.pull_request.number%"
293-
thirdPullUrl: "%payload.pull_request.html_url%"
294-
left: "%payload.pull_request.title%"
295-
operator: ===
296-
right: Create better comments
297-
# if those statments FAIL... do this
298-
else:
299-
- type: respond
300-
with: e-rename-pr.md
301-
data:
302-
title: Create better comments
303311
- type: octokit
304312
method: projects.listForRepo
305313
owner: "%payload.repository.owner.login%"
306314
repo: "%payload.repository.name%"
307315
action_id: projectBoard
316+
store:
317+
thirdPullNumber: "%payload.pull_request.number%"
318+
thirdPullUrl: "%payload.pull_request.html_url%"
308319
- type: octokit
309320
method: projects.listColumns
310321
project_id: "%actions.projectBoard.data.0.id%"
@@ -329,6 +340,15 @@ steps:
329340
event: pull_request.synchronize
330341
link: "{{store.thirdPullUrl}}"
331342
actions:
343+
- type: gate
344+
left: '{{ payload.pull_request.number }}'
345+
operator: ===
346+
right: '{{ store.thirdPullNumber }}'
347+
else:
348+
- type: respond
349+
with: e-generic.md
350+
data:
351+
expected: push a commit to '{{ store.thirdPullNumber }}'
332352
- type: createReview
333353
body: 08_merge-workflow.md
334354
event: APPROVE
@@ -338,6 +358,18 @@ steps:
338358
event: pull_request.closed
339359
link: "{{store.thirdPullUrl}}"
340360
actions:
361+
- type: gate
362+
every: true
363+
gates:
364+
- left: '{{ payload.pull_request.number }}'
365+
operator: ===
366+
right: '{{ store.thirdPullNumber }}'
367+
- left: '{{ payload.pull_request.merged }}'
368+
else:
369+
- type: respond
370+
with: e-generic.md
371+
data:
372+
expected: merge pull request '{{ store.thirdPullNumber }}'
341373
- type: octokit
342374
action_id: triggerIssue
343375
method: issues.create

responses/06_steps-activity.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ We will make the following changes to the current workflow file:
4747
```
4848
4949
2. Commit the workflow to a new branch.
50-
3. Create a pull request titled **Create better comments**.
51-
4. Supply the pull request body content and click `Create pull request`.
50+
3. Create a pull request, I suggest the title **Create better comments**.
51+
4. Supply the pull request body content and click **Create pull request**.
5252
5353
---
5454

0 commit comments

Comments
 (0)