Skip to content

Commit

Permalink
fix hardcoded api endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
yimysty committed Aug 5, 2022
1 parent 677bce1 commit d8dd132
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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, {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/enable-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/get-pages-base-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down

0 comments on commit d8dd132

Please sign in to comment.