Skip to content

Commit 7cdbd14

Browse files
committed
Adding repo dispatcher trigger
1 parent 39ccc95 commit 7cdbd14

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

scripts/dispatch.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const http = require('https');
2+
const querystring = require('querystring');
3+
4+
var options = {
5+
host: 'api.github.com',
6+
port: 443,
7+
path: '/repos/hmanzur/terraform-aws-ecs-test/dispatches',
8+
method: 'POST',
9+
headers: {
10+
'Accept': 'application/vnd.github.v3+json',
11+
'Authorization': `token ${process.env.AUTH_TOKEN}`
12+
}
13+
}
14+
15+
16+
const request = http.request(options, response => {
17+
response.on('data', function (chunk) {
18+
process.stdout.write(chunk);
19+
});
20+
});
21+
22+
request.on('error', (e) => {
23+
console.error(e);
24+
});
25+
26+
request.write(querystring.stringify({
27+
event_type: 'build'
28+
}));
29+
30+
request.end();

0 commit comments

Comments
 (0)