mirror of
https://github.com/actions/configure-pages.git
synced 2026-03-30 10:04:52 +00:00
Update index.js
This commit is contained in:
11
src/index.js
11
src/index.js
@@ -1,18 +1,23 @@
|
|||||||
const core = require('@actions/core')
|
const core = require('@actions/core')
|
||||||
const axios = require('axios')
|
const axios = require('axios')
|
||||||
|
|
||||||
|
// All variables we need from the runtime are loaded here
|
||||||
|
const getContext = require('./context')
|
||||||
|
|
||||||
async function getPageBaseUrl() {
|
async function getPageBaseUrl() {
|
||||||
try {
|
try {
|
||||||
const pagesEndpoint = `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages`
|
const context = getContext()
|
||||||
|
|
||||||
core.info("GITHUB_TOKEN : " + process.env.GITHUB_TOKEN)
|
const pagesEndpoint = `https://api.github.com/repos/${context.repositoryNwo}/pages`
|
||||||
|
|
||||||
|
core.info("GITHUB_TOKEN : " + context.githubToken)
|
||||||
|
|
||||||
const response = await axios.get(
|
const response = await axios.get(
|
||||||
pagesEndpoint,
|
pagesEndpoint,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/vnd.github.v3+json',
|
Accept: 'application/vnd.github.v3+json',
|
||||||
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`
|
Authorization: `Bearer ${context.githubToken}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user