This repository has been archived by the owner on Sep 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
config.yml
129 lines (113 loc) · 4.06 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Generated by generate-config.js
# DO NOT EDIT DIRECTLY
# Instead, edit generate-config.js and re-run script
title: <MY-COURSE-TITLE>
tagline: Learn CodeQL in this course
description: >-
Learn CodeQL in this course
template:
repo: <MY-COURSE-REPO>-template
name: <MY-COURSE-REPO>
before:
- type: createIssue
title: 'Step 1 - Your first query'
body: step-1.md
action_id: step_1
- type: assignRegistrant
issue: '%actions.step_1.data.number%'
steps:
- title: "Your first query"
description: "Write your first query"
event: commit_comment.created
link: '{{ repoUrl }}/issues/1'
actions:
# Ensure comment is posted by github-actions
- type: gate
left: '%payload.sender.login%'
operator: ===
right: github-actions[bot]
# Ensure comment is relevant for this issue
- type: gate
left: '%payload.comment.body%'
operator: search
# regex-escape then yaml-escape the expected markdown string
right: "/Results for `step-1\\.ql`\\:/"
# Ensure comment has expected completed string
- type: gate
left: '%payload.comment.body%'
operator: search
# regex-escape then yaml-escape the expected markdown string
right: "/Results for `step-1\\.ql`\\: \\*\\*correct\\*\\* \\(3 results\\)/"
else:
- type: respond
issue: "Step 1 - Your first query"
with: fail.md
data:
commit: '%payload.comment.commit_id%'
commentUrl: '%payload.comment.html_url%'
# Answer is correct!!
# Create Issue for next task
- type: createIssue
title: "Step 2 - Your second query"
body: step-2.md
action_id: next_issue
- type: assignRegistrant
issue: '%actions.next_issue.data.number%'
# Make comment on current issue with link to commit that introduces correct query
- type: respond
issue: "Step 1 - Your first query"
with: next.md
data:
next_issue: '%actions.next_issue.data.html_url%'
commit: '%payload.comment.commit_id%'
# Make comment on commit with link to next issue
- type: octokit
method: repos.createCommitComment
owner: '%payload.repository.owner.login%'
repo: '%payload.repository.name%'
sha: '%payload.comment.commit_id%'
body: |
Congratulations, looks like the query you introduced for step 1 finds the correct results!
Take a look at the [instructions for the next step](%actions.next_issue.data.html_url%) to continue.
# Close current issue
- type: closeIssue
issue: "Step 1 - Your first query"
- title: "Your second query"
description: "Write your second query"
event: commit_comment.created
link: '{{ repoUrl }}/issues'
actions:
# Ensure comment is posted by github-actions
- type: gate
left: '%payload.sender.login%'
operator: ===
right: github-actions[bot]
# Ensure comment is relevant for this issue
- type: gate
left: '%payload.comment.body%'
operator: search
# regex-escape then yaml-escape the expected markdown string
right: "/Results for `step-2\\.ql`\\:/"
# Ensure comment has expected completed string
- type: gate
left: '%payload.comment.body%'
operator: search
# regex-escape then yaml-escape the expected markdown string
right: "/Results for `step-2\\.ql`\\: \\*\\*correct\\*\\* \\(5 results\\)/"
else:
- type: respond
issue: "Step 2 - Your second query"
with: fail.md
data:
commit: '%payload.comment.commit_id%'
commentUrl: '%payload.comment.html_url%'
# Answer is correct!!
# Make comment on current issue with final message
- type: respond
issue: "Step 2 - Your second query"
with: end.md
data:
commit: '%payload.comment.commit_id%'
# Close current issue
- type: closeIssue
issue: "Step 2 - Your second query"