Adds option to disable the use of Github Environments

pull/26/head
Jonathan Visser 3 years ago
parent 364c7ca09a
commit 6b8523d5d4

@ -22,6 +22,9 @@ inputs:
branch:
description: "The name of the branch you want to deploy to"
required: false
skipGithubEnvironment:
description: "Disables the use of Github Environments"
required: false
runs:
using: "node16"
main: "index.js"

@ -16116,6 +16116,7 @@ try {
const directory = (0, import_core.getInput)("directory", { required: true });
const gitHubToken = (0, import_core.getInput)("gitHubToken", { required: true });
const branch = (0, import_core.getInput)("branch", { required: false });
const skipGithubEnvironment = (0, import_core.getInput)("skipGithubEnvironment", { required: false }) === "true";
const octokit = (0, import_github.getOctokit)(gitHubToken);
const createPagesDeployment = async () => {
await esm_default`
@ -16164,7 +16165,10 @@ try {
});
};
(async () => {
const gitHubDeployment = await createGitHubDeployment();
let gitHubDeployment;
if (!skipGithubEnvironment) {
gitHubDeployment = await createGitHubDeployment();
}
const pagesDeployment = await createPagesDeployment();
(0, import_core.setOutput)("id", pagesDeployment.id);
(0, import_core.setOutput)("url", pagesDeployment.url);

@ -54,6 +54,7 @@ try {
const directory = getInput("directory", { required: true });
const gitHubToken = getInput("gitHubToken", { required: true });
const branch = getInput("branch", { required: false });
const skipGithubEnvironment = getInput("skipGithubEnvironment", { required: false }) === 'true';
const octokit = getOctokit(gitHubToken);
@ -120,7 +121,10 @@ try {
};
(async () => {
const gitHubDeployment = await createGitHubDeployment();
let gitHubDeployment;
if (!skipGithubEnvironment) {
gitHubDeployment = await createGitHubDeployment();
}
const pagesDeployment = await createPagesDeployment();

Loading…
Cancel
Save