forked from wzieba/Firebase-Distribution-Github-Action
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.sh
executable file
·39 lines (32 loc) · 1.25 KB
/
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
35
36
37
38
39
#!/bin/bash
# Required since https://github.blog/2022-04-12-git-security-vulnerability-announced
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_SERVICECREDENTIALSFILECONTENT}" ] ; then
cat <<< "${INPUT_SERVICECREDENTIALSFILECONTENT}" > service_credentials_content.json
export GOOGLE_APPLICATION_CREDENTIALS="service_credentials_content.json"
fi
firebase \
appdistribution:distribute \
"$INPUT_FILE" \
--app "$INPUT_APPID" \
--groups "$INPUT_GROUPS" \
--testers "$INPUT_TESTERS" \
${RELEASE_NOTES:+ --release-notes "${RELEASE_NOTES}"} \
${INPUT_RELEASENOTESFILE:+ --release-notes-file "${RELEASE_NOTES_FILE}"} \
$( (( $INPUT_DEBUG )) && printf %s '--debug' ) \
> output.txt
bash /usr/local/bin/parse_output.sh "$(cat output.txt)"