Skip to content

Readme Generator - Contributors #7506

Readme Generator - Contributors

Readme Generator - Contributors #7506

name: Readme Generator - Contributors
on:
schedule:
- cron: "* */2 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
generate:
name: Generate Contributors
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.FA_TOKEN }}
- name: Generate Contributors Images
uses: sticknologic/github-action-contributors@main
id: contributors
with:
token: ${{ secrets.FA_TOKEN }}
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\]|github-actions\[bot\])
avatarSize: 42
- name: Modify README.md
uses: jaywcjlove/github-action-modify-file-content@main
with:
token: ${{ secrets.FA_TOKEN }}
path: README.md
body: '${{steps.contributors.outputs.htmlList}}'
- name: Trigger docs workflow
run: |
htmlList=$(cat <<'EOF'
${{ steps.contributors.outputs.htmlList }}
EOF
)
htmlListBase64=$(echo "$htmlList" | base64 -w 0)
jq -n --arg htmlListBase64 "$htmlListBase64" \
'{"event_type":"update_contributors","client_payload":{"htmlListBase64":$htmlListBase64}}' > payload.json
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.FA_WF }}" \
https://api.github.com/repos/STICKnoLOGIC/First-Accord-Docs/dispatches \
-d @payload.json