Skip to content

Commit

Permalink
Add co-authors to AUTHORS.txt
Browse files Browse the repository at this point in the history
From Co-authored-by commit message trailers.
  • Loading branch information
at-wat committed Jan 10, 2023
1 parent 500903f commit 2b4e475
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ci/.github/generate-authors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
set -e

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

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


IFS=$'\n' #Only split on newline
for CONTRIBUTOR in $(git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf); do
for CONTRIBUTOR in $(
(
git log --format='%aN <%aE>'
git log --format='%(trailers:key=Co-authored-by)' | sed -n 's/^[^:]*:\s*//p'
) | LC_ALL=C.UTF-8 sort -uf
); do
if shouldBeIncluded ${CONTRIBUTOR}; then
CONTRIBUTORS+=("${CONTRIBUTOR}")
fi
Expand Down

0 comments on commit 2b4e475

Please sign in to comment.