mirror of
https://github.com/mukul975/Anthropic-Cybersecurity-Skills.git
synced 2026-08-28 12:19:41 +03:00
The Thanks-to-our-contributors block was hand-maintained and had gone stale: it listed 8 people where the API reports 13, omitting valorisa (second by contribution count with 18), Daytona39264, kevglynn, OctoBored and farhan6667. tools/update-contributors.py regenerates the block between <!-- contributors:start --> and <!-- contributors:end --> from the GitHub contributors API, ordered by contribution count, bots excluded, with the contribution count in each avatar's tooltip. It has a --check mode and refuses to write an empty wall if the API returns nothing. .github/workflows/update-contributors.yml runs it on push to main, weekly, and on demand, committing only when the block actually changes. The weekly pass exists because the contributors API is cached and can lag a merge by about a day, so a push-triggered run alone would miss people. Avatars come from github.com/<login>.png rather than a third-party contributor-image service. A README image is fetched on every page view, so an external host would be an uncontrolled dependency in the most-viewed file in the repository - the same objection raised against the star-history endpoint swap in #124.
45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
name: Update contributors
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
schedule:
|
|
# GitHub's contributors API is cached and lags a merge by up to ~24h, so a
|
|
# weekly pass catches anyone the push-triggered run was too early to see.
|
|
- cron: '17 4 * * 1'
|
|
workflow_dispatch:
|
|
|
|
# Only one run at a time; a burst of merges must not race on README.md.
|
|
concurrency:
|
|
group: update-contributors
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
update:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Regenerate the contributor wall
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: python3 tools/update-contributors.py
|
|
|
|
- name: Commit if it changed
|
|
run: |
|
|
git config user.name "mukul975"
|
|
git config user.email "mukuljangra5@gmail.com"
|
|
git add README.md
|
|
if git diff --staged --quiet; then
|
|
echo "No new contributors."
|
|
exit 0
|
|
fi
|
|
git commit -m "chore: update contributor wall"
|
|
# Another workflow (update-index) may have pushed while this ran.
|
|
git pull --rebase --autostash origin main
|
|
git push
|