Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Smitha Borkar authored and GitHub committed Jun 8, 2022
1 parent 10aeb52 commit 4350717
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
const core = require('@actions/core')
const axios = require('axios')

// All variables we need from the runtime are loaded here
const getContext = require('./context')

async function getPageBaseUrl() {
try {
const pagesEndpoint = `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages`
const context = getContext()

const pagesEndpoint = `https://api.github.com/repos/${context.repositoryNwo}/pages`

core.info("GITHUB_TOKEN : " + process.env.GITHUB_TOKEN)
core.info("GITHUB_TOKEN : " + context.githubToken)

const response = await axios.get(
pagesEndpoint,
{
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`
Authorization: `Bearer ${context.githubToken}`
}
}
)
Expand Down

0 comments on commit 4350717

Please sign in to comment.