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

Commit f804a20

Browse files
committed
add docs links to gate
1 parent 3bd08d0 commit f804a20

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

responses/09.0_add-context.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
### Step 10: Add validation
2-
We need to validate against the learner's pull request title. This information is accessible to us from the payload that is sent with the API. In this case, the information was sent from a `pull_request.opened` event.
2+
We need to validate against the learner's pull request title. This information is accessible to us [:book: from the payload](https://github.github.com/learning-lab-equipment/#/3-3-writing-steps?id=accessing-payload-data) that is sent with the event. In this case, the information was sent from a `pull_request.opened` event.
33

4-
We'll add the `left:` option to the gate, and set it to the pull request's title.
4+
You can see an example of all the information sent [in the GitHub Developer docs](https://developer.github.com/v3/activity/events/types/#webhook-payload-example-26).
55

6-
A completed example of this would look like:
6+
We'll add the [:book: `left:` option](https://github.github.com/learning-lab-equipment/#/actions/gate/?id=options) to the gate, and compare its value to the expected pull request's title.
7+
8+
A completed example of this would look as follows, with comments on the right starting with a hash `#`:
79
```yaml
810
actions:
9-
- type: gate
10-
left: '%payload.pull_request.title%'
11-
operator: ===
12-
right: Add name to README
11+
- type: gate # using the gate action
12+
left: '%payload.pull_request.title%' # get the title from the pull request object inside of the payload
13+
operator: === # check for strict equality, see more at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators#Identity
14+
right: Add name to README # this is the expected value
1315
```
1416
1517
### :keyboard: Activity: Adding validation

0 commit comments

Comments
 (0)