diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7d95292..bac01ec 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -40,6 +40,51 @@ jobs: with: name: pages + - name: "Generate a security.txt file" + run: | + tee security.txt << EOF + Contact: $(gh api '/repos/${{ github.repository }}' --jq '.homepage')/contact + Policy: $(gh api '/repos/${{ github.repository }}' --jq '.homepage')/security/policy + Acknowledgments: $(gh api '/repos/${{ github.repository }}' --jq '.homepage')/humans.txt + Canonical: $(gh api '/repos/${{ github.repository }}' --jq '.homepage')/security.txt + Expires: $(date -u +"%Y-12-31T23:59:59.999Z") + EOF + + - name: "Generate a humans.txt file" + run: gh api "${ENDPOINT}" --template "${TEMPLATE}" | sh | tee humans.txt + env: + ENDPOINT: '/orgs/${{ github.repository_owner }}/repos' + TEMPLATE: | + echo "# Contributors by Repository" + echo + echo "A huge thanks to all and colaborators who have contributed on GitHub!" + echo + {{range .}} + echo "## {{.full_name}}" + echo + gh api '/repos/{{.full_name}}/contributors' --jq '.[].login' | sort -u | xargs -ILOGIN gh api '/users/LOGIN' --jq '"- @" + .login + " (" + (.name // .login) + ")"' + echo + {{end}} + + - name: "Generate a robots.txt file" + run: | + tee security.txt << EOF + Sitemap: $(gh api '/repos/${{ github.repository }}' --jq '.homepage')/sitemap.txt + EOF + + - name: "Generate a sitemap.txt file" + run: | + tee sitemap.txt << EOF + $( + find . -type f -printf '%P\n' | \ + grep -v '^\.' | \ + sed -e 's/\(\.html\)*$//g' | \ + sort | \ + uniq | \ + xargs -IPATH gh api '/repos/${{ github.repository }}' --jq '.homepage + "/PATH"' + ) + EOF + - name: "Create a Pages Artifact" uses: actions/upload-pages-artifact@v1 with: