From 55b2e346e39ebb30acfb83236f7bdf06a79901d6 Mon Sep 17 00:00:00 2001 From: Bruno Paz <184563+brpaz@users.noreply.github.com> Date: Sun, 12 Jun 2022 12:00:54 +0100 Subject: [PATCH] updates --- action.yml | 4 ++-- index.js | 7 ++++--- src/index.ts | 8 +++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/action.yml b/action.yml index 9aa0bbc..1bdb02c 100644 --- a/action.yml +++ b/action.yml @@ -19,8 +19,8 @@ inputs: gitHubToken: description: "GitHub Token" required: true - envrionment: - description: "The envrionment to deploy" + branch: + description: "The name of the branch you want to deploy to" required: false runs: using: "node16" diff --git a/index.js b/index.js index 6a9b271..a06c444 100644 --- a/index.js +++ b/index.js @@ -16115,7 +16115,7 @@ try { const projectName = (0, import_core.getInput)("projectName", { required: true }); const directory = (0, import_core.getInput)("directory", { required: true }); const gitHubToken = (0, import_core.getInput)("gitHubToken", { required: true }); - const environment = (0, import_core.getInput)("environment", { required: false }); + const branch = (0, import_core.getInput)("branch", { required: false }); const octokit = (0, import_github.getOctokit)(gitHubToken); const createPagesDeployment = async () => { await esm_default` @@ -16125,7 +16125,7 @@ try { } if ${environment} { - $$ npx wrangler@2 pages publish "${directory}" --project-name="${projectName}" --env="${environment}" + $$ npx wrangler@2 pages publish "${directory}" --project-name="${projectName}" --branch="${branch}" } else { $$ npx wrangler@2 pages publish "${directory}" --project-name="${projectName}" } @@ -16155,7 +16155,7 @@ try { environmentName, productionEnvironment }) => { - await octokit.rest.repos.createDeploymentStatus({ + let result = await octokit.rest.repos.createDeploymentStatus({ owner: import_github.context.repo.owner, repo: import_github.context.repo.repo, deployment_id: id, @@ -16166,6 +16166,7 @@ try { description: "Cloudflare Pages", state: "success" }); + console.log(result); }; (async () => { const gitHubDeployment = await createGitHubDeployment(); diff --git a/src/index.ts b/src/index.ts index 74496b8..ff40235 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,7 +53,7 @@ try { const projectName = getInput("projectName", { required: true }); const directory = getInput("directory", { required: true }); const gitHubToken = getInput("gitHubToken", { required: true }); - const environment = getInput("environment", { required: false }); + const branch = getInput("branch", { required: false }); const octokit = getOctokit(gitHubToken); @@ -66,7 +66,7 @@ try { } if ${environment} { - $$ npx wrangler@2 pages publish "${directory}" --project-name="${projectName}" --env="${environment}" + $$ npx wrangler@2 pages publish "${directory}" --project-name="${projectName}" --branch="${branch}" } else { $$ npx wrangler@2 pages publish "${directory}" --project-name="${projectName}" } @@ -109,7 +109,7 @@ try { environmentName: string; productionEnvironment: boolean; }) => { - await octokit.rest.repos.createDeploymentStatus({ + let result = await octokit.rest.repos.createDeploymentStatus({ owner: context.repo.owner, repo: context.repo.repo, deployment_id: id, @@ -121,6 +121,8 @@ try { description: "Cloudflare Pages", state: "success", }); + + console.log(result); }; (async () => {