Skip to content

Commit 774698e

Browse files
refactor: ♻️ update get-contributors (#179)
# Description This PR updates `get-contributors`. This PR needs a quick review. ## Checklist - [x] Formatted Markdown - [x] Ran `just run-all` --------- Co-authored-by: Luke W. Johnston <[email protected]>
1 parent 80ae6fa commit 774698e

File tree

7 files changed

+37
-8
lines changed

7 files changed

+37
-8
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ Please note that this project is released with a [Contributor Code of
4545
Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree
4646
to abide by its terms.
4747

48+
### Contributors
49+
50+
The following people have contributed to this project by submitting pull
51+
requests :tada:
52+
53+
[@lwjohnst86](https://github.com/lwjohnst86),
54+
[@martonvago](https://github.com/martonvago),
55+
[@signekb](https://github.com/signekb)
56+
4857
## Licensing
4958

5059
This project is licensed under the [MIT

README.qmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ Please note that this project is released with a [Contributor Code of
3434
Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree
3535
to abide by its terms.
3636

37+
### Contributors
38+
39+
{{< include /docs/includes/_contributors.qmd >}}
40+
3741
## Licensing
3842

3943
This project is licensed under the [MIT

_quarto.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
project:
22
type: seedcase-theme
3-
pre-render:
4-
- sh ./tools/get-contributors.sh
53
render:
64
# Don't render anything in the template directory.
75
- "!template/"

docs/includes/_contributors.qmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The following people have contributed to this project by submitting pull requests :tada:
2+
3+
[\@lwjohnst86](https://github.com/lwjohnst86), [\@martonvago](https://github.com/martonvago), [\@signekb](https://github.com/signekb)

index.qmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ We would love your feedback or contributions! Head over to our [GitHub
4949
repository](https://github.com/seedcase-project/{{< meta repo >}}) to
5050
share your ideas or contribute code. Your input makes us better!
5151

52+
### Contributors
53+
54+
{{< include /docs/includes/_contributors.qmd >}}
55+
5256
## Licensing
5357

5458
This project is licensed under the [MIT License](/LICENSE.md).

justfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
just --list --unsorted
33

44
@_tests: test
5+
@_builds: build-contributors build-website build-readme
56

67
# Run all build-related recipes in the justfile
7-
run-all: check-spelling check-commits test build-website build-readme
8+
run-all: check-spelling check-commits _tests _builds
89

910
# Install the pre-commit hooks
1011
install-precommit:
@@ -100,3 +101,7 @@ build-website:
100101
# Re-build the README file from the Quarto version
101102
build-readme:
102103
uvx --from quarto quarto render README.qmd --to gfm
104+
105+
# Generate a Quarto include file with the contributors
106+
build-contributors:
107+
sh ./tools/get-contributors.sh seedcase-project/template-python-project > docs/includes/_contributors.qmd

tools/get-contributors.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
#!/usr/bin/env bash
22

3-
# Get a list of contributors to the Seedcase Sprout repository
4-
# and save it to contributors.txt.tmp file. It also:
3+
# Get a list of contributors to this repository and save it to
4+
# _contributors.qmd file (overwritten if it exists). It also:
55
#
66
# - Formats users into Markdown links to their GitHub profiles.
77
# - Removes any usernames with the word "bot" in them.
88
# - Removes the trailing comma from the list.
9-
gh api \
10-
/repos/seedcase-project/seedcase-sprout/contributors \
9+
repo_spec=${1}
10+
contributors=$(gh api \
11+
-H "Accept: application/vnd.github+json" \
12+
-H "X-GitHub-Api-Version: 2022-11-28" \
13+
/repos/$repo_spec/contributors \
1114
--template '{{range .}} [\@{{.login}}]({{.html_url}}){{"\n"}}{{end}}' | \
1215
grep -v "\[bot\]" | \
1316
tr '\n' ', ' | \
14-
sed -e 's/,$//' > contributors.txt.tmp
17+
sed -e 's/,$/\n/'
18+
)
19+
20+
echo "The following people have contributed to this project by submitting pull requests :tada:\n\n${contributors}"

0 commit comments

Comments
 (0)