Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions template/tools/get-contributors.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/usr/bin/env bash

# Get a list of contributors to this repository and save it to
# _contributors.qmd.tmp file. It also:
# _contributors.qmd file (overwritten if it exists). It also:
#
# - Formats users into Markdown links to their GitHub profiles.
# - Removes any usernames with the word "bot" in them.
# - Removes the trailing comma from the list.
repo_spec=${1}
echo "These are the people who have contributed by submitting changes through pull requests :tada:\n\n" > _contributors.qmd.tmp
echo "These are the people who have contributed by submitting changes through pull requests :tada:\n\n" > _contributors.qmd
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/$repo_spec/contributors \
--template '{{range .}} [\@{{.login}}]({{.html_url}}){{"\n"}}{{end}}' | \
grep -v "\[bot\]" | \
tr '\n' ', ' | \
sed -e 's/,$//' >> _contributors.qmd.tmp
sed -e 's/,$//' >> _contributors.qmd
Loading