Skip to content

Commit

Permalink
Allow a user to manually opt-out of Pages site enablement
Browse files Browse the repository at this point in the history
  • Loading branch information
James M. Greene authored and James M. Greene committed Aug 3, 2022
1 parent 677bce1 commit 0455a16
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
description: "GitHub token"
default: ${{ github.token }}
required: true
enablement:
description: "Should a Pages site be enabled for the repository if not so already?"
default: "true"
required: false
outputs:
base_url:
description: 'GitHub Pages site full base URL. Examples: "https://octocat.github.io/my-repo/", "https://octocat.github.io/", "https://www.example.com/"'
Expand Down
7 changes: 5 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14718,7 +14718,8 @@ function getRequiredVars() {
return {
repositoryNwo: process.env.GITHUB_REPOSITORY,
githubToken: core.getInput('token'),
staticSiteGenerator: core.getInput('static_site_generator')
staticSiteGenerator: core.getInput('static_site_generator'),
enablement: core.getInput('enablement') !== 'false'
}
}

Expand Down Expand Up @@ -16384,7 +16385,9 @@ const {getContext} = __nccwpck_require__(1319)
async function main() {
try {
const context = getContext()
await enablePages(context)
if (context.enablement) {
await enablePages(context)
}
await getPagesBaseUrl(context)
} catch (error) {
core.setFailed(error)
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ function getRequiredVars() {
return {
repositoryNwo: process.env.GITHUB_REPOSITORY,
githubToken: core.getInput('token'),
staticSiteGenerator: core.getInput('static_site_generator')
staticSiteGenerator: core.getInput('static_site_generator'),
enablement: core.getInput('enablement') !== 'false'
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const {getContext} = require('./context')
async function main() {
try {
const context = getContext()
await enablePages(context)
if (context.enablement) {
await enablePages(context)
}
await getPagesBaseUrl(context)
} catch (error) {
core.setFailed(error)
Expand Down

0 comments on commit 0455a16

Please sign in to comment.