Skip to content

Commit 2b4e475

Browse files
committed
Add co-authors to AUTHORS.txt
From Co-authored-by commit message trailers.
1 parent 500903f commit 2b4e475

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ci/.github/generate-authors.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
set -e
1313

1414
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
15-
GIT_WORKDIR=${GITHUB_WORKSPACE:-$(git rev-parse --show-toplevel)}
16-
AUTHORS_PATH="${GIT_WORKDIR}/AUTHORS.txt"
15+
if [ -z "${AUTHORS_PATH}" ]; then
16+
AUTHORS_PATH="$GITHUB_WORKSPACE/AUTHORS.txt"
17+
fi
1718

1819
if [ -f ${SCRIPT_PATH}/.ci.conf ]; then
1920
. ${SCRIPT_PATH}/.ci.conf
@@ -41,7 +42,12 @@ shouldBeIncluded () {
4142

4243

4344
IFS=$'\n' #Only split on newline
44-
for CONTRIBUTOR in $(git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf); do
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
4551
if shouldBeIncluded ${CONTRIBUTOR}; then
4652
CONTRIBUTORS+=("${CONTRIBUTOR}")
4753
fi

0 commit comments

Comments
 (0)