diff --git a/src/deploy.ts b/src/deploy.ts index 9c46405f..aa9ccec8 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -45,6 +45,7 @@ type DeployConfig = { target?: string; // Optional version specification for firebase-tools. Defaults to `latest`. firebaseToolsVersion?: string; + debug?: boolean; }; export type ChannelDeployConfig = DeployConfig & { @@ -70,8 +71,8 @@ export function interpretChannelDeployResult( async function execWithCredentials( args: string[], - projectId, - gacFilename, + projectId: string, + gacFilename: string, opts: { debug?: boolean; firebaseToolsVersion?: string } ) { let deployOutputBuf: Buffer[] = []; @@ -127,7 +128,7 @@ export async function deployPreview( gacFilename: string, deployConfig: ChannelDeployConfig ) { - const { projectId, channelId, target, expires, firebaseToolsVersion } = + const { projectId, channelId, target, expires, firebaseToolsVersion, debug } = deployConfig; const deploymentText = await execWithCredentials( @@ -139,7 +140,7 @@ export async function deployPreview( ], projectId, gacFilename, - { firebaseToolsVersion } + { firebaseToolsVersion, debug } ); const deploymentResult = JSON.parse(deploymentText.trim()) as @@ -150,16 +151,17 @@ export async function deployPreview( } export async function deployProductionSite( - gacFilename, + gacFilename: string, productionDeployConfig: ProductionDeployConfig ) { - const { projectId, target, firebaseToolsVersion } = productionDeployConfig; + const { projectId, target, firebaseToolsVersion, debug } = + productionDeployConfig; const deploymentText = await execWithCredentials( ["deploy", "--only", `hosting${target ? ":" + target : ""}`], projectId, gacFilename, - { firebaseToolsVersion } + { firebaseToolsVersion, debug } ); const deploymentResult = JSON.parse(deploymentText) as diff --git a/src/index.ts b/src/index.ts index ef90f2db..d8d4a4b0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,6 +16,7 @@ import { endGroup, + getBooleanInput, getInput, setFailed, setOutput, @@ -50,6 +51,7 @@ const octokit = token ? getOctokit(token) : undefined; const entryPoint = getInput("entryPoint"); const target = getInput("target"); const firebaseToolsVersion = getInput("firebaseToolsVersion"); +const debug = getBooleanInput("debug"); async function run() { const isPullRequest = !!context.payload.pull_request; @@ -93,6 +95,7 @@ async function run() { projectId, target, firebaseToolsVersion, + debug, }); if (deployment.status === "error") { throw Error((deployment as ErrorResult).error); @@ -121,6 +124,7 @@ async function run() { channelId, target, firebaseToolsVersion, + debug, }); if (deployment.status === "error") {