From 43507179c9de46b888dc779e749b4fd0eef78852 Mon Sep 17 00:00:00 2001 From: Smitha Borkar <12040799+smithaborkar@users.noreply.github.com> Date: Tue, 7 Jun 2022 22:21:08 -0700 Subject: [PATCH] Update index.js --- src/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 85802ef..4b3ad85 100644 --- a/src/index.js +++ b/src/index.js @@ -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}` } } )