@@ -22,7 +22,7 @@ import {
2222 startGroup ,
2323} from "@actions/core" ;
2424import { context , getOctokit } from "@actions/github" ;
25- import { existsSync } from "fs" ;
25+ import { existsSync , unlinkSync } from "fs" ;
2626import { createGacFile } from "./createGACFile" ;
2727import {
2828 deployPreview ,
@@ -51,7 +51,7 @@ const firebaseToolsVersion = getInput("firebaseToolsVersion");
5151
5252async function run ( ) {
5353 try {
54- startGroup ( "Verifying firebase.json exists " ) ;
54+ startGroup ( "Verifying setup parameters " ) ;
5555
5656 if ( entryPoint !== "." ) {
5757 console . log ( `Changing to directory: ${ entryPoint } ` ) ;
@@ -61,21 +61,15 @@ async function run() {
6161 throw Error ( `Error changing to directory ${ entryPoint } : ${ err } ` ) ;
6262 }
6363 }
64-
6564 if ( existsSync ( "./firebase.json" ) ) {
6665 console . log ( "firebase.json file found. Continuing deploy." ) ;
6766 } else {
6867 console . warn ( "firebase.json file not found. If your firebase.json file is not in the root of your repo, edit the entryPoint option of this GitHub action." ) ;
6968 }
70- endGroup ( ) ;
71-
72- startGroup ( "Setting up CLI credentials" ) ;
73- console . log ( "validating passed credentials: %s" , googleApplicationCredentials ) ;
7469 const gacFilename = await createGacFile ( googleApplicationCredentials ) ;
75- console . log ( "generated credentials: %s" , gacFilename )
7670 if ( gacFilename !== googleApplicationCredentials ) {
7771 console . log (
78- "Created a temporary file with Application Default Credentials."
72+ "Created a temporary file with Google Application Credentials."
7973 ) ;
8074 }
8175 endGroup ( ) ;
@@ -90,6 +84,11 @@ async function run() {
9084 await deployToPreviewChannel ( gacFilename , channelId ) ;
9185 endGroup ( ) ;
9286 }
87+
88+ // cleanup
89+ if ( gacFilename !== googleApplicationCredentials ) {
90+ unlinkSync ( gacFilename ) ;
91+ }
9392 } catch ( e ) {
9493 setFailed ( e . message ) ;
9594 }
0 commit comments