mirror of
https://github.com/actions/configure-pages.git
synced 2026-02-12 05:11:23 +00:00
21 lines
526 B
JavaScript
21 lines
526 B
JavaScript
const core = require('@actions/core')
|
|
|
|
// Load variables from Actions runtime
|
|
function getRequiredVars() {
|
|
return {
|
|
repositoryNwo: process.env.GITHUB_REPOSITORY,
|
|
githubToken: core.getInput('token')
|
|
}
|
|
}
|
|
|
|
module.exports = function getContext() {
|
|
const requiredVars = getRequiredVars()
|
|
for (const variable in requiredVars) {
|
|
if (requiredVars[variable] === undefined) {
|
|
throw new Error(`${variable} is undefined. Cannot continue.`)
|
|
}
|
|
}
|
|
core.debug('all variables are set')
|
|
return requiredVars
|
|
}
|