From 6b8523d5d4daa29d45b7bb9cf95c5c7870de7629 Mon Sep 17 00:00:00 2001 From: Jonathan Visser Date: Thu, 1 Sep 2022 20:03:26 +0200 Subject: [PATCH] Adds option to disable the use of Github Environments --- action.yml | 3 +++ index.js | 6 +++++- src/index.ts | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 1bdb02c..58bdd17 100644 --- a/action.yml +++ b/action.yml @@ -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" diff --git a/index.js b/index.js index 58fa930..56cf3b4 100644 --- a/index.js +++ b/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); diff --git a/src/index.ts b/src/index.ts index 8b57e0c..d32b3c6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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();