Skip to content

Commit

Permalink
Generate a humans.md file as part of the build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
norwd authored Jan 5, 2025
1 parent d575aac commit 6711a0d
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,35 @@ jobs:
{{- /* noop */ -}}
- name: "Generate a humans.md file"
run: gh api "${ENDPOINT}" --template "${TEMPLATE}" | sh | tee humans.md
env:
ENDPOINT: '/orgs/${{ github.repository_owner }}/repos'
JQ_QUERY: '"- " + (.name // .login) + " aka [@" + .login + "](" + .html_url + ")"'
TEMPLATE: |
echo "# Humans to Thank"
echo
echo "A huge thanks to all and colaborators who have contributed on GitHub!"
echo
{{range .}}
echo "## Contributors [{{.full_name}}]({{.html_url}})"
echo
gh api '/repos/{{.full_name}}/contributors' --jq '.[].login' | sort -u | xargs -ILOGIN gh api '/users/LOGIN' --jq "${JQ_QUERY}"
echo
{{end}}
- name: "Create generated HTML files"
run: |
make -f - << \EOF
all: $(patsubst %.md,%.html,$(wildcard *.md */*.md */*/*.md))
all: $(patsubst %.md,%.html,$(wildcard *.md */*.md */*/*.md)) humans.txt
rm -f header.html
%.html: %.md
pandoc --metadata-file=authors.yaml --template=GitHub.html5 --include-in-header=header.html --from markdown+yaml_metadata_block+backtick_code_blocks+fenced_code_attributes+inline_notes+emoji-implicit_figures --to html --standalone $< --output $@
pandoc --metadata-file=authors.yaml --template=GitHub.html5 --include-in-header=header.html --from markdown+yaml_metadata_block+backtick_code_blocks+fenced_code_attributes+inline_notes+emoji-implicit_figures+shortcut_reference_links+spaced_reference_links+autolink_bare_uris-citations --to html --standalone $< --output $@
%.txt: %.html
pandoc --from html --to plain --wrap=none $< --output $@
EOF
Expand Down

0 comments on commit 6711a0d

Please sign in to comment.