forked from testsigmahq/testsigma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.js
39 lines (30 loc) · 784 Bytes
/
action.js
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
var https = require("https");
let IssueUrl = {
init() {
const ISSUE_URL = process.argv.slice(2)[0].replace('--url=', '');
return (ISSUE_URL);
}
};
main();
function main(){
let url = IssueUrl.init()
var options = {
host: 'api.github.com',
path: url,
method: 'GET',
headers: {'user-agent': 'node.js'}
};
var request = https.request(options, function(response){
var body = '';
response.on("data", function(chunk){
body += chunk.toString('utf8');
});
response.on("end", function(){
console.log(`"Github Link:${JSON.parse(body).html_url +'\\n\\n'+ JSON.stringify(JSON.parse(body).body).slice(1)}`);
});
});
request.on('error', function(err) {
console.log("Issue in fetching the details");
});
request.end();
}