forked from wzieba/Firebase-Distribution-Github-Action
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.sh
executable file
·35 lines (27 loc) · 933 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
git config --global --add safe.directory /github/workspace
RELEASE_NOTES=""
RELEASE_NOTES_FILE=""
if [[ -z ${INPUT_RELEASENOTES} ]]; then
RELEASE_NOTES="$(git log -1 --pretty=short)"
else
RELEASE_NOTES=${INPUT_RELEASENOTES}
fi
if [[ ${INPUT_RELEASENOTESFILE} ]]; then
RELEASE_NOTES=""
RELEASE_NOTES_FILE=${INPUT_RELEASENOTESFILE}
fi
if [ -n "${INPUT_SERVICECREDENTIALSFILE}" ] ; then
export GOOGLE_APPLICATION_CREDENTIALS="${INPUT_SERVICECREDENTIALSFILE}"
fi
if [ -n "${INPUT_TOKEN}" ] ; then
export FIREBASE_TOKEN="${INPUT_TOKEN}"
fi
firebase \
appdistribution:distribute \
"$INPUT_FILE" \
--app "$INPUT_APPID" \
--groups "$INPUT_GROUPS" \
${RELEASE_NOTES:+ --release-notes "${RELEASE_NOTES}"} \
${INPUT_RELEASENOTESFILE:+ --release-notes-file "${RELEASE_NOTES_FILE}"} \
$( (( $INPUT_DEBUG )) && printf %s '--debug' )