diff --git a/bin/action.min.js b/bin/action.min.js index 3530b852..3eebb2ab 100644 --- a/bin/action.min.js +++ b/bin/action.min.js @@ -92943,9 +92943,10 @@ function interpretChannelDeployResult(deployResult) { async function execWithCredentials(args, projectId, gacFilename, opts) { let deployOutputBuf = []; const debug = opts.debug || false; + const packageExecute = opts.packageExecute || 'npx'; const firebaseToolsVersion = opts.firebaseToolsVersion || "latest"; try { - await exec_1.exec(`npx firebase-tools@${firebaseToolsVersion}`, [...args, ...(projectId ? ["--project", projectId] : []), debug ? "--debug" // gives a more thorough error message + await exec_1.exec(`${packageExecute} firebase-tools@${firebaseToolsVersion}`, [...args, ...(projectId ? ["--project", projectId] : []), debug ? "--debug" // gives a more thorough error message : "--json" // allows us to easily parse the output ], { listeners: { @@ -93167,6 +93168,9 @@ async function postChannelSuccessComment(github, context, result, commit) { * limitations under the License. */ // Inputs defined in action.yml +const packageExecute = core.getInput("packageExecute", { + trimWhitespace: true +}); const expires = core.getInput("expires"); const projectId = core.getInput("projectId"); const googleApplicationCredentials = core.getInput("firebaseServiceAccount", { @@ -93208,6 +93212,7 @@ async function run() { if (isProductionDeploy) { core.startGroup("Deploying to production site"); const deployment = await deployProductionSite(gacFilename, { + packageExecute, projectId, target, firebaseToolsVersion @@ -93231,6 +93236,7 @@ async function run() { const channelId = getChannelId(configuredChannelId, github.context); core.startGroup(`Deploying to Firebase preview channel ${channelId}`); const deployment = await deployPreview(gacFilename, { + packageExecute, projectId, expires, channelId, diff --git a/src/deploy.ts b/src/deploy.ts index 9c46405f..8152c878 100644 --- a/src/deploy.ts +++ b/src/deploy.ts @@ -41,6 +41,7 @@ export type ProductionSuccessResult = { }; type DeployConfig = { + packageExecute?: string; projectId: string; target?: string; // Optional version specification for firebase-tools. Defaults to `latest`. @@ -72,15 +73,16 @@ async function execWithCredentials( args: string[], projectId, gacFilename, - opts: { debug?: boolean; firebaseToolsVersion?: string } + opts: { debug?: boolean; firebaseToolsVersion?: string, packageExecute?: string } ) { let deployOutputBuf: Buffer[] = []; const debug = opts.debug || false; + const packageExecute = opts.packageExecute || 'npx'; const firebaseToolsVersion = opts.firebaseToolsVersion || "latest"; try { await exec( - `npx firebase-tools@${firebaseToolsVersion}`, + `${packageExecute} firebase-tools@${firebaseToolsVersion}`, [ ...args, ...(projectId ? ["--project", projectId] : []), diff --git a/src/index.ts b/src/index.ts index ef90f2db..25bf14c5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,6 +38,7 @@ import { } from "./postOrUpdateComment"; // Inputs defined in action.yml +const packageExecute = getInput("packageExecute", {trimWhitespace: true}); const expires = getInput("expires"); const projectId = getInput("projectId"); const googleApplicationCredentials = getInput("firebaseServiceAccount", { @@ -90,6 +91,7 @@ async function run() { if (isProductionDeploy) { startGroup("Deploying to production site"); const deployment = await deployProductionSite(gacFilename, { + packageExecute, projectId, target, firebaseToolsVersion, @@ -116,6 +118,7 @@ async function run() { startGroup(`Deploying to Firebase preview channel ${channelId}`); const deployment = await deployPreview(gacFilename, { + packageExecute, projectId, expires, channelId,