1212set -e
1313
1414SCRIPT_PATH=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " ; pwd -P )
15- AUTHORS_PATH=" $GITHUB_WORKSPACE /AUTHORS.txt"
15+ GIT_WORKDIR=${GITHUB_WORKSPACE:- $(git rev-parse --show-toplevel)}
16+ AUTHORS_PATH=" ${GIT_WORKDIR} /AUTHORS.txt"
1617
17- if [ -f ${SCRIPT_PATH} /.ci.conf ]
18- then
18+ if [ -f ${SCRIPT_PATH} /.ci.conf ]; then
1919 . ${SCRIPT_PATH} /.ci.conf
2020fi
2121
@@ -31,8 +31,7 @@ EXCLUDED_CONTRIBUTORS+=('John R. Bradley' 'renovate[bot]' 'Renovate Bot' 'Pion B
3131CONTRIBUTORS=()
3232
3333shouldBeIncluded () {
34- for i in " ${EXCLUDED_CONTRIBUTORS[@]} "
35- do
34+ for i in " ${EXCLUDED_CONTRIBUTORS[@]} " ; do
3635 if [[ $1 =~ " $i " ]]; then
3736 return 1
3837 fi
@@ -42,25 +41,23 @@ shouldBeIncluded () {
4241
4342
4443IFS=$' \n ' # Only split on newline
45- for contributor in $( git log --format=' %aN <%aE>' | LC_ALL=C.UTF-8 sort -uf)
46- do
47- if shouldBeIncluded $contributor ; then
48- CONTRIBUTORS+=(" $contributor " )
44+ for CONTRIBUTOR in $( git log --format=' %aN <%aE>' | LC_ALL=C.UTF-8 sort -uf) ; do
45+ if shouldBeIncluded ${CONTRIBUTOR} ; then
46+ CONTRIBUTORS+=(" ${CONTRIBUTOR} " )
4947 fi
5048done
5149unset IFS
5250
5351if [ ${# CONTRIBUTORS[@]} -ne 0 ]; then
54- cat > $AUTHORS_PATH << -'EOH '
52+ cat > ${ AUTHORS_PATH} << -'EOH '
5553# Thank you to everyone that made Pion possible. If you are interested in contributing
5654# we would love to have you https://github.com/pion/webrtc/wiki/Contributing
5755#
5856# This file is auto generated, using git to list all individuals contributors.
5957# see `.github/generate-authors.sh` for the scripting
6058EOH
61- for i in " ${CONTRIBUTORS[@]} "
62- do
63- echo " $i " >> $AUTHORS_PATH
59+ for i in " ${CONTRIBUTORS[@]} " ; do
60+ echo " $i " >> ${AUTHORS_PATH}
6461 done
6562 exit 0
6663fi
0 commit comments