File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,39 +2,10 @@ name: Update Contributors
22
33on :
44 schedule :
5- - cron : ' 0 0 * * *' # Run daily at midnight UTC
6- workflow_dispatch : # Allow manual trigger
5+ - cron : ' 0 0 * * *'
6+ workflow_dispatch :
77
88jobs :
99 contributors :
10- runs-on : ubuntu-latest
11- steps :
12- - uses : actions/checkout@v4
13- with :
14- token : ${{ secrets.CONTRIBUTORS_TOKEN }}
15-
16- - name : Update contributors
17- env :
18- GH_TOKEN : ${{ secrets.CONTRIBUTORS_TOKEN }}
19- run : |
20- # Fetch contributors from GitHub API (exclude bots) - markdown format
21- contributors=$(gh api repos/CodingWithCalvin/VsixSdk/contributors --paginate --jq '.[] | select(.type != "Bot") | select(.login | test("\\[bot\\]$") | not) | "[&s=64)](\(.html_url))"' | tr '\n' ' ')
22-
23- # Build the contributors section
24- contrib_section="<!-- readme: contributors -start -->
25- $contributors
26- <!-- readme : contributors -end -->"
27-
28- # Update README between the markers
29- awk -v contrib="$contrib_section" '
30- /<!-- readme : contributors -start -->/{found=1; print contrib; next}
31- /<!-- readme : contributors -end -->/{found=0; next}
32- !found{print}
33- ' README.md > README.tmp && mv README.tmp README.md
34-
35- - name: Commit and push
36- run: |
37- git config user.name "github-actions[bot]"
38- git config user.email "github-actions[bot]@users.noreply.github.com"
39- git add README.md
40- git diff --staged --quiet || (git commit -m "docs: update contributors [skip ci]" && git push)
10+ uses : CodingWithCalvin/.github/.github/workflows/contributors.yml@main
11+ secrets : inherit
You can’t perform that action at this time.
0 commit comments