Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove createCheck #345

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions bin/action.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -87331,26 +87331,6 @@ exports.getOctokit = getOctokit;

});

// create a check and return a function that updates (completes) it
async function createCheck(github, context) {
var _context$payload$pull;
const check = await github.rest.checks.create({
...context.repo,
name: "Deploy Preview",
head_sha: (_context$payload$pull = context.payload.pull_request) == null ? void 0 : _context$payload$pull.head.sha,
status: "in_progress"
});
return async details => {
await github.rest.checks.update({
...context.repo,
check_run_id: check.data.id,
completed_at: new Date().toISOString(),
status: "completed",
...details
});
};
}

// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
Expand Down Expand Up @@ -92976,7 +92956,6 @@ async function execWithCredentials(args, projectId, gacFilename, opts) {
}
return deployOutputBuf.length ? deployOutputBuf[deployOutputBuf.length - 1].toString("utf-8") : ""; // output from the CLI
}

async function deployPreview(gacFilename, deployConfig) {
const {
projectId,
Expand Down Expand Up @@ -93184,10 +93163,6 @@ const firebaseToolsVersion = core.getInput("firebaseToolsVersion");
const disableComment = core.getInput("disableComment");
async function run() {
const isPullRequest = !!github.context.payload.pull_request;
let finish = details => console.log(details);
if (token && isPullRequest) {
finish = await createCheck(octokit, github.context);
}
try {
core.startGroup("Verifying firebase.json exists");
if (entryPoint !== ".") {
Expand Down Expand Up @@ -93219,16 +93194,6 @@ async function run() {
throw Error(deployment.error);
}
core.endGroup();
const hostname = target ? `${target}.web.app` : `${projectId}.web.app`;
const url = `https://${hostname}/`;
await finish({
details_url: url,
conclusion: "success",
output: {
title: `Production deploy succeeded`,
summary: `[${hostname}](${url})`
}
});
return;
}
const channelId = getChannelId(configuredChannelId, github.context);
Expand Down Expand Up @@ -93260,23 +93225,8 @@ async function run() {
const commitId = (_context$payload$pull = github.context.payload.pull_request) == null ? void 0 : _context$payload$pull.head.sha.substring(0, 7);
await postChannelSuccessComment(octokit, github.context, deployment, commitId);
}
await finish({
details_url: urls[0],
conclusion: "success",
output: {
title: `Deploy preview succeeded`,
summary: getURLsMarkdownFromChannelDeployResult(deployment)
}
});
} catch (e) {
core.setFailed(e.message);
await finish({
conclusion: "failure",
output: {
title: "Deploy preview failed",
summary: `Error: ${e.message}`
}
});
}
}
run();
40 changes: 0 additions & 40 deletions src/createCheck.ts

This file was deleted.

34 changes: 0 additions & 34 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
} from "@actions/core";
import { context, getOctokit } from "@actions/github";
import { existsSync } from "fs";
import { createCheck } from "./createCheck";
import { createGacFile } from "./createGACFile";
import {
deployPreview,
Expand Down Expand Up @@ -55,11 +54,6 @@ const disableComment = getInput("disableComment");
async function run() {
const isPullRequest = !!context.payload.pull_request;

let finish = (details: Object) => console.log(details);
if (token && isPullRequest) {
finish = await createCheck(octokit, context);
}

try {
startGroup("Verifying firebase.json exists");

Expand Down Expand Up @@ -99,17 +93,6 @@ async function run() {
throw Error((deployment as ErrorResult).error);
}
endGroup();

const hostname = target ? `${target}.web.app` : `${projectId}.web.app`;
const url = `https://${hostname}/`;
await finish({
details_url: url,
conclusion: "success",
output: {
title: `Production deploy succeeded`,
summary: `[${hostname}](${url})`,
},
});
return;
}

Expand Down Expand Up @@ -146,25 +129,8 @@ async function run() {

await postChannelSuccessComment(octokit, context, deployment, commitId);
}

await finish({
details_url: urls[0],
conclusion: "success",
output: {
title: `Deploy preview succeeded`,
summary: getURLsMarkdownFromChannelDeployResult(deployment),
},
});
} catch (e) {
setFailed(e.message);

await finish({
conclusion: "failure",
output: {
title: "Deploy preview failed",
summary: `Error: ${e.message}`,
},
});
}
}

Expand Down