62
62
ENDPOINT : ' /repos/${{ github.repository }}/contributors'
63
63
JQ_QUERY : ' "author-meta:" + (["", (.[] | .login)] | join("\n- "))'
64
64
65
+ - name : " Generate a humans.txt file"
66
+ run : gh api "${ENDPOINT}" --template "${TEMPLATE}" | sh | tee humans.txt
67
+ env :
68
+ ENDPOINT : ' /orgs/${{ github.repository_owner }}/repos'
69
+ TEMPLATE : |
70
+ echo "# Contributors by Repository"
71
+ echo
72
+ echo "A huge thanks to all and colaborators who have contributed on GitHub!"
73
+ echo
74
+ {{range .}}
75
+ echo "## {{.full_name}}"
76
+ echo
77
+ gh api '/repos/{{.full_name}}/contributors' --jq '.[].login' | sort -u | xargs -ILOGIN gh api '/users/LOGIN' --jq '"- @" + .login + " (" + (.name // .login) + ")"'
78
+ echo
79
+ {{end}}
80
+
65
81
- name : " Generate a changelog.md file"
66
82
run : gh api "${ENDPOINT}" --template "${TEMPLATE}" | tee changelog.md
67
83
env :
@@ -105,10 +121,18 @@ jobs:
105
121
- name : " Create generated HTML files"
106
122
run : |
107
123
make -f - << \EOF
124
+ .PHONY: all text-to-markdown markdown-to-html
108
125
109
- all: $(patsubst %.md,%. html,$(wildcard *.md */*.md */*/*.md))
126
+ all: text-to-markdown markdown-to- html
110
127
rm -f header.html
111
128
129
+ markdown-to-html: $(patsubst %.md,%.html,$(wildcard *.md */*.md */*/*.md))
130
+
131
+ text-to-markdown: $(patsubst %.txt,%.md,$(wildcard *.txt */*.txt */*/*.txt))
132
+
133
+ %.md: %.txt
134
+ cp $< $@
135
+
112
136
%.html: %.md
113
137
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 $@
114
138
@@ -117,10 +141,13 @@ jobs:
117
141
- name : " Create redirect HTML files"
118
142
run : |
119
143
make -f - << \EOF
144
+ .PHONY: all redirect-to-html
120
145
121
- all: $(patsubst %. redirect,%. html,$(wildcard *.redirect */*.redirect */*/*.redirect))
146
+ all: redirect-to- html
122
147
rm -f redirect.html $(wildcard *.redirect */*.redirect */*/*.redirect)
123
148
149
+ redirect-to-html: $(patsubst %.redirect,%.html,$(wildcard *.redirect */*.redirect */*/*.redirect))
150
+
124
151
%.html: %.redirect
125
152
@echo "Generating $@..."
126
153
$(file > $@, $(subst {{ .REDIRECT }},$(file < $<),$(file < redirect.html)))
0 commit comments