pull/33/head
Daniel Walsh 3 years ago
parent 7430fe507a
commit c74fab918c
No known key found for this signature in database
GPG Key ID: 2533E346A14D232D

@ -22123,13 +22123,18 @@ try {
}
const gitHubDeployment = await createGitHubDeployment();
const pagesDeployment = await createPagesDeployment();
console.log(pagesDeployment);
const productionEnvironment = pagesDeployment.environment === "production";
(0, import_core.setOutput)("id", pagesDeployment.id);
(0, import_core.setOutput)("url", pagesDeployment.url);
(0, import_core.setOutput)("environment", pagesDeployment.environment);
(0, import_core.setOutput)("alias", pagesDeployment.environment === "production" ? pagesDeployment.url : pagesDeployment.aliases[0]);
const productionEnvironment = pagesDeployment.environment === "production";
const environmentName = productionEnvironment ? "Production" : `Preview (${pagesDeployment.aliases[0]})`;
(0, import_core.setOutput)("alias", productionEnvironment ? pagesDeployment.url : pagesDeployment.aliases[0]);
let environmentName;
if (productionEnvironment) {
environmentName = "Production";
} else {
const url = new URL(pagesDeployment.aliases[0]);
environmentName = `Preview (${url.hostname.split(".")[0]})`;
}
if (gitHubDeployment) {
await createGitHubDeploymentStatus({
id: gitHubDeployment.id,

@ -2,7 +2,7 @@ import { getInput, setOutput, setFailed } from "@actions/core";
import { context, getOctokit } from "@actions/github";
import shellac from "shellac";
import { fetch } from "undici";
import { Deployment } from '@cloudflare/types';
import type { Deployment } from '@cloudflare/types';
try {
const apiToken = getInput("apiToken", { required: true });
@ -87,19 +87,21 @@ try {
const pagesDeployment = await createPagesDeployment();
// wut
console.log(pagesDeployment);
const productionEnvironment = pagesDeployment.environment === "production";
setOutput("id", pagesDeployment.id);
setOutput("url", pagesDeployment.url);
setOutput("environment", pagesDeployment.environment);
setOutput("alias", pagesDeployment.environment === "production" ? pagesDeployment.url : pagesDeployment.aliases[0]);
setOutput("alias", productionEnvironment ? pagesDeployment.url : pagesDeployment.aliases[0]);
const productionEnvironment = pagesDeployment.environment === "production";
const environmentName = productionEnvironment
? "Production"
let environmentName: string;
if (productionEnvironment) {
environmentName = "Production"
} else {
const url = new URL(pagesDeployment.aliases[0]);
// Use the branch alias (staging/walshy-fix-bug)
: `Preview (${pagesDeployment.aliases[0]})`;
environmentName = `Preview (${url.hostname.split(".")[0]})`;
}
if (gitHubDeployment) {
await createGitHubDeploymentStatus({

Loading…
Cancel
Save