@@ -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 ,
@@ -52,7 +52,7 @@ const disableComment = getInput("disableComment");
5252
5353async function run ( ) {
5454 try {
55- startGroup ( "Verifying firebase.json exists " ) ;
55+ startGroup ( "Verifying setup parameters " ) ;
5656
5757 if ( entryPoint !== "." ) {
5858 console . log ( `Changing to directory: ${ entryPoint } ` ) ;
@@ -62,21 +62,15 @@ async function run() {
6262 throw Error ( `Error changing to directory ${ entryPoint } : ${ err } ` ) ;
6363 }
6464 }
65-
6665 if ( existsSync ( "./firebase.json" ) ) {
6766 console . log ( "firebase.json file found. Continuing deploy." ) ;
6867 } else {
6968 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." ) ;
7069 }
71- endGroup ( ) ;
72-
73- startGroup ( "Setting up CLI credentials" ) ;
74- console . log ( "validating passed credentials: %s" , googleApplicationCredentials ) ;
7570 const gacFilename = await createGacFile ( googleApplicationCredentials ) ;
76- console . log ( "generated credentials: %s" , gacFilename )
7771 if ( gacFilename !== googleApplicationCredentials ) {
7872 console . log (
79- "Created a temporary file with Application Default Credentials."
73+ "Created a temporary file with Google Application Credentials."
8074 ) ;
8175 }
8276 endGroup ( ) ;
@@ -91,6 +85,11 @@ async function run() {
9185 await deployToPreviewChannel ( gacFilename , channelId ) ;
9286 endGroup ( ) ;
9387 }
88+
89+ // cleanup
90+ if ( gacFilename !== googleApplicationCredentials ) {
91+ unlinkSync ( gacFilename ) ;
92+ }
9493 } catch ( e ) {
9594 setFailed ( e . message ) ;
9695 }
0 commit comments