File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 1818 const isFromPulls = !!payload.issue.pull_request;
1919 const commentBody = payload.comment.body;
2020
21+ if (isFromPulls && commentBody) {
22+ if (commentBody.indexOf("/ok-to-test") == 0) {
23+ // Get pull request
24+ const pull = await github.pulls.get({
25+ owner: issue.owner,
26+ repo: issue.repo,
27+ pull_number: issue.number
28+ });
29+ if (pull && pull.data) {
30+ // Get commit id and repo from pull head
31+ const testPayload = {
32+ pull_head_ref: pull.data.head.sha,
33+ pull_head_repo: pull.data.head.repo.full_name,
34+ command: "ok-to-test",
35+ issue: issue,
36+ };
37+ // Fire repository_dispatch event to trigger conformance test
38+ await github.repos.createDispatchEvent({
39+ owner: issue.owner,
40+ repo: issue.repo,
41+ event_type: "conformance-test",
42+ client_payload: testPayload,
43+ });
44+ }
45+
2146 if (!isFromPulls && commentBody && commentBody.indexOf("/assign") == 0) {
2247 if (!issue.assignees || issue.assignees.length === 0) {
2348 await github.issues.addAssignees({
2954 }
3055
3156 return;
32- }
57+ }
You can’t perform that action at this time.
0 commit comments