12
12
set -e
13
13
14
14
SCRIPT_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"
16
17
17
- if [ -f ${SCRIPT_PATH} /.ci.conf ]
18
- then
18
+ if [ -f ${SCRIPT_PATH} /.ci.conf ]; then
19
19
. ${SCRIPT_PATH} /.ci.conf
20
20
fi
21
21
@@ -31,8 +31,7 @@ EXCLUDED_CONTRIBUTORS+=('John R. Bradley' 'renovate[bot]' 'Renovate Bot' 'Pion B
31
31
CONTRIBUTORS=()
32
32
33
33
shouldBeIncluded () {
34
- for i in " ${EXCLUDED_CONTRIBUTORS[@]} "
35
- do
34
+ for i in " ${EXCLUDED_CONTRIBUTORS[@]} " ; do
36
35
if [[ $1 =~ " $i " ]]; then
37
36
return 1
38
37
fi
@@ -42,25 +41,23 @@ shouldBeIncluded () {
42
41
43
42
44
43
IFS=$' \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} " )
49
47
fi
50
48
done
51
49
unset IFS
52
50
53
51
if [ ${# CONTRIBUTORS[@]} -ne 0 ]; then
54
- cat > $AUTHORS_PATH << -'EOH '
52
+ cat > ${ AUTHORS_PATH} << -'EOH '
55
53
# Thank you to everyone that made Pion possible. If you are interested in contributing
56
54
# we would love to have you https://github.com/pion/webrtc/wiki/Contributing
57
55
#
58
56
# This file is auto generated, using git to list all individuals contributors.
59
57
# see `.github/generate-authors.sh` for the scripting
60
58
EOH
61
- for i in " ${CONTRIBUTORS[@]} "
62
- do
63
- echo " $i " >> $AUTHORS_PATH
59
+ for i in " ${CONTRIBUTORS[@]} " ; do
60
+ echo " $i " >> ${AUTHORS_PATH}
64
61
done
65
62
exit 0
66
63
fi
0 commit comments