Skip to content

Commit 82b0a90

Browse files
authored
include GOOGLE_APPLICATION_CREDENTIALS check (#5)
Signed-off-by: Vinicius Tosta <[email protected]>
1 parent 821a1e2 commit 82b0a90

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ A GitHub Action to deploy to Firebase for Node18.
55
- Make sure that you checkout the repository using the [actions/checkout](https://github.com/actions/checkout) action
66
- Make sure that you have the `firebase.json` file in the repository
77
- To obtain the Firebase token, run `firebase login:ci` on your local computer and [store the token](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) as the `FIREBASE_TOKEN` secret
8+
- To obtain service account credentials, get the service account JSON file from Firebase console and set its path to `GOOGLE_APPLICATION_CREDENTIALS`
9+
- Either `FIREBASE_TOKEN` or `GOOGLE_APPLICATION_CREDENTIALS` are required to deploy the project. No need to set both at the same time.
810
- Specify the Firebase project name in the `FIREBASE_PROJECT` env var
911

1012
## Workflow examples

entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ npm install
44

55
cd functions; npm install
66

7-
if [ -z "${FIREBASE_TOKEN}" ]; then
8-
echo "FIREBASE_TOKEN is missing"
7+
if [[ -z "${FIREBASE_TOKEN}" && -z "${GOOGLE_APPLICATION_CREDENTIALS}" ]]; then
8+
echo "Access tokens are missing! Provide either FIREBASE_TOKEN or GOOGLE_APPLICATION_CREDENTIALS"
99
exit 1
1010
fi
1111

0 commit comments

Comments
 (0)