Skip to content

Commit 3b5a887

Browse files
tanvigourartursouzadapr-bot
authored
ok-to-test changes for components-contrib (dapr#1091)
* eventhubs metadata propagation * ok-to-test changes * Revert "eventhubs metadata propagation" This reverts commit 2903695. * ok-to-test changes based on review Co-authored-by: Artur Souza <artursouza.ms@outlook.com> Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
1 parent f8d4c03 commit 3b5a887

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

.github/workflows/dapr-bot.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,31 @@ jobs:
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({
@@ -29,4 +54,4 @@ jobs:
2954
}
3055
3156
return;
32-
}
57+
}

0 commit comments

Comments
 (0)