fix hardcoded api endpoint

This commit is contained in:
yimysty
2022-08-05 09:52:17 -07:00
parent 677bce1797
commit d8dd1327a1
4 changed files with 5 additions and 5 deletions

4
dist/index.js vendored
View File

@@ -14746,7 +14746,7 @@ const core = __nccwpck_require__(2186)
const axios = __nccwpck_require__(6545)
async function enablePages({repositoryNwo, githubToken}) {
const pagesEndpoint = `https://api.github.com/repos/${repositoryNwo}/pages`
const pagesEndpoint = `${process.env.GITHUB_API_URL ?? 'https://api.github.com'}/repos/${repositoryNwo}/pages`
try {
const response = await axios.post(
@@ -14790,7 +14790,7 @@ async function getPagesBaseUrl({
staticSiteGenerator
}) {
try {
const pagesEndpoint = `https://api.github.com/repos/${repositoryNwo}/pages`
const pagesEndpoint = `${process.env.GITHUB_API_URL ?? 'https://api.github.com'}/repos/${repositoryNwo}/pages`
core.info(`Get the Base URL to the page with endpoint ${pagesEndpoint}`)
const response = await axios.get(pagesEndpoint, {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@@ -2,7 +2,7 @@ const core = require('@actions/core')
const axios = require('axios')
async function enablePages({repositoryNwo, githubToken}) {
const pagesEndpoint = `https://api.github.com/repos/${repositoryNwo}/pages`
const pagesEndpoint = `${process.env.GITHUB_API_URL ?? 'https://api.github.com'}/repos/${repositoryNwo}/pages`
try {
const response = await axios.post(

View File

@@ -8,7 +8,7 @@ async function getPagesBaseUrl({
staticSiteGenerator
}) {
try {
const pagesEndpoint = `https://api.github.com/repos/${repositoryNwo}/pages`
const pagesEndpoint = `${process.env.GITHUB_API_URL ?? 'https://api.github.com'}/repos/${repositoryNwo}/pages`
core.info(`Get the Base URL to the page with endpoint ${pagesEndpoint}`)
const response = await axios.get(pagesEndpoint, {