try some logging

This commit is contained in:
Jeremy Daley
2023-02-10 01:39:32 -05:00
parent ccd0e3abe9
commit 50408c8053
3 changed files with 13 additions and 9 deletions

8
dist/index.js vendored
View File

@@ -13035,15 +13035,17 @@ async function enablePagesSite({ repositoryNwo, githubToken, proxy }) {
} }
async function getPagesSite({ repositoryNwo, githubToken, proxy }) { async function getPagesSite({ repositoryNwo, githubToken, proxy }) {
console.log('Using proxy:', proxy)
const pagesEndpoint = `${getApiBaseUrl()}/repos/${repositoryNwo}/pages` const pagesEndpoint = `${getApiBaseUrl()}/repos/${repositoryNwo}/pages`
const config = {
const response = await axios.get(pagesEndpoint, {
...(proxy ? { httpsAgent: HPA(proxy) } : {}), ...(proxy ? { httpsAgent: HPA(proxy) } : {}),
headers: { headers: {
Accept: 'application/vnd.github.v3+json', Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${githubToken}` Authorization: `Bearer ${githubToken}`
} }
}) }
const response = await axios.get(pagesEndpoint, config)
const pageObject = response.data const pageObject = response.data
return pageObject return pageObject

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@@ -35,15 +35,17 @@ async function enablePagesSite({ repositoryNwo, githubToken, proxy }) {
} }
async function getPagesSite({ repositoryNwo, githubToken, proxy }) { async function getPagesSite({ repositoryNwo, githubToken, proxy }) {
console.log('Using proxy:', proxy)
const pagesEndpoint = `${getApiBaseUrl()}/repos/${repositoryNwo}/pages` const pagesEndpoint = `${getApiBaseUrl()}/repos/${repositoryNwo}/pages`
const config = {
const response = await axios.get(pagesEndpoint, {
...(proxy ? { httpsAgent: HPA(proxy) } : {}), ...(proxy ? { httpsAgent: HPA(proxy) } : {}),
headers: { headers: {
Accept: 'application/vnd.github.v3+json', Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${githubToken}` Authorization: `Bearer ${githubToken}`
} }
}) }
const response = await axios.get(pagesEndpoint, config)
const pageObject = response.data const pageObject = response.data
return pageObject return pageObject