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
+ if [ -z " ${AUTHORS_PATH} " ]; then
16
+ AUTHORS_PATH=" $GITHUB_WORKSPACE /AUTHORS.txt"
17
+ fi
16
18
17
- if [ -f ${SCRIPT_PATH} /.ci.conf ]
18
- then
19
+ if [ -f ${SCRIPT_PATH} /.ci.conf ]; then
19
20
. ${SCRIPT_PATH} /.ci.conf
20
21
fi
21
22
@@ -31,8 +32,7 @@ EXCLUDED_CONTRIBUTORS+=('John R. Bradley' 'renovate[bot]' 'Renovate Bot' 'Pion B
31
32
CONTRIBUTORS=()
32
33
33
34
shouldBeIncluded () {
34
- for i in " ${EXCLUDED_CONTRIBUTORS[@]} "
35
- do
35
+ for i in " ${EXCLUDED_CONTRIBUTORS[@]} " ; do
36
36
if [[ $1 =~ " $i " ]]; then
37
37
return 1
38
38
fi
@@ -42,25 +42,28 @@ shouldBeIncluded () {
42
42
43
43
44
44
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 " )
45
+ for CONTRIBUTOR in $(
46
+ (
47
+ git log --format=' %aN <%aE>'
48
+ git log --format=' %(trailers:key=Co-authored-by)' | sed -n ' s/^[^:]*:\s*//p'
49
+ ) | LC_ALL=C.UTF-8 sort -uf
50
+ ) ; do
51
+ if shouldBeIncluded ${CONTRIBUTOR} ; then
52
+ CONTRIBUTORS+=(" ${CONTRIBUTOR} " )
49
53
fi
50
54
done
51
55
unset IFS
52
56
53
57
if [ ${# CONTRIBUTORS[@]} -ne 0 ]; then
54
- cat > $AUTHORS_PATH << -'EOH '
58
+ cat > ${ AUTHORS_PATH} << -'EOH '
55
59
# Thank you to everyone that made Pion possible. If you are interested in contributing
56
60
# we would love to have you https://github.com/pion/webrtc/wiki/Contributing
57
61
#
58
62
# This file is auto generated, using git to list all individuals contributors.
59
63
# see `.github/generate-authors.sh` for the scripting
60
64
EOH
61
- for i in " ${CONTRIBUTORS[@]} "
62
- do
63
- echo " $i " >> $AUTHORS_PATH
65
+ for i in " ${CONTRIBUTORS[@]} " ; do
66
+ echo " $i " >> ${AUTHORS_PATH}
64
67
done
65
68
exit 0
66
69
fi
0 commit comments