Pass github token in headers and not as a query param (#1246)
* Pass github token in headers and not as a query param * fix lint issue * Update js/review-app-slack-webhook.js Co-Authored-By: Christopher DeCairos <christopherd@mozillafoundation.org> Co-authored-by: Christopher DeCairos <christopherd@mozillafoundation.org>
This commit is contained in:
Родитель
3b69d54e98
Коммит
71aa24a687
|
@ -17,8 +17,13 @@ const slack_webhook = process.env.SLACK_WEBHOOK;
|
|||
// For review app manually created, we have to use the branch name instead.
|
||||
if (pr_number) {
|
||||
request(
|
||||
`https://api.github.com/repos/${org}/${repo}/pulls/${pr_number}&access_token=${github_token}`,
|
||||
{ headers: { "User-Agent": "request" } },
|
||||
`https://api.github.com/repos/${org}/${repo}/pulls/${pr_number}`,
|
||||
{
|
||||
headers: {
|
||||
"User-Agent": "request",
|
||||
Authorization: `token ${github_token}`
|
||||
}
|
||||
},
|
||||
function(error, response, body) {
|
||||
if (!error && response.statusCode === 200) {
|
||||
const pr_title = JSON.parse(body)["title"];
|
||||
|
|
Загрузка…
Ссылка в новой задаче