Skip to content

Commit

Permalink
try some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-daley-kr committed Feb 10, 2023
1 parent ccd0e3a commit 50408c8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
10 changes: 6 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13035,15 +13035,17 @@ async function enablePagesSite({ repositoryNwo, githubToken, proxy }) {
}

async function getPagesSite({ repositoryNwo, githubToken, proxy }) {
console.log('Using proxy:', proxy)
const pagesEndpoint = `${getApiBaseUrl()}/repos/${repositoryNwo}/pages`

const response = await axios.get(pagesEndpoint, {
...(proxy ? {httpsAgent: HPA(proxy)} : {}),
const config = {
...(proxy ? { httpsAgent: HPA(proxy) } : {}),
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${githubToken}`
}
})
}

const response = await axios.get(pagesEndpoint, config)

const pageObject = response.data
return pageObject
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions src/api-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ async function enablePagesSite({ repositoryNwo, githubToken, proxy }) {
}

async function getPagesSite({ repositoryNwo, githubToken, proxy }) {
console.log('Using proxy:', proxy)
const pagesEndpoint = `${getApiBaseUrl()}/repos/${repositoryNwo}/pages`

const response = await axios.get(pagesEndpoint, {
...(proxy ? {httpsAgent: HPA(proxy)} : {}),
const config = {
...(proxy ? { httpsAgent: HPA(proxy) } : {}),
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${githubToken}`
}
})
}

const response = await axios.get(pagesEndpoint, config)

const pageObject = response.data
return pageObject
Expand Down

0 comments on commit 50408c8

Please sign in to comment.