Fix authentication

pull/1786/head
Paul Sauve 8 years ago
parent 5b3fed3e49
commit 8d9374c2aa

@ -8,7 +8,7 @@ sudo: required
env:
global:
- BUILD_TIMEOUT=10000
- BROWSER_USERNAME=PaulBGD
- BROWSER_USERNAME=paulsauve1
cache:
directories:
- "$HOME/.yarn-cache"

@ -67,7 +67,7 @@ const headers = {
Authorization: `token ${githubToken}`
};
fetch(`https://api.github.com/repos/sveltejs/svelte/issues/${pullRequest}/comments`, { headers })
fetch(`https://api.github.com/repos/sveltejs/svelte/issues/${pullRequest}/comments`)
.then(res => res.json())
.then(res => {
let addComment = false;
@ -82,8 +82,9 @@ fetch(`https://api.github.com/repos/sveltejs/svelte/issues/${pullRequest}/commen
if (addComment) {
const contents = '<details><summary>Benchmark Results</summary>' + fs.readFileSync(outputFile) + '</details>';
let action;
if (editId === null) {
return fetch(`https://api.github.com/repos/sveltejs/svelte/issues/${pullRequest}/comments`, {
action = fetch(`https://api.github.com/repos/sveltejs/svelte/issues/${pullRequest}/comments`, {
method: 'POST',
headers,
body: JSON.stringify({
@ -91,7 +92,7 @@ fetch(`https://api.github.com/repos/sveltejs/svelte/issues/${pullRequest}/commen
})
});
} else {
return fetch(`https://api.github.com/repos/sveltejs/svelte/issues/comments/${editId}`, {
action = fetch(`https://api.github.com/repos/sveltejs/svelte/issues/comments/${editId}`, {
method: 'PATCH',
headers,
body: JSON.stringify({
@ -99,5 +100,6 @@ fetch(`https://api.github.com/repos/sveltejs/svelte/issues/${pullRequest}/commen
})
});
}
return action.then(res => res.json()).then(res => console.log('[DEBUG]', res));
}
});

Loading…
Cancel
Save