Skip to content

Commit db3f0b7

Browse files
committed
fix(workflow): use shared contributors workflow
Switch to reusable workflow from CodingWithCalvin/.github for easier maintenance across all repos.
1 parent efd7fe6 commit db3f0b7

1 file changed

Lines changed: 4 additions & 33 deletions

File tree

.github/workflows/contributors.yml

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,10 @@ name: Update Contributors
22

33
on:
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

88
jobs:
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) | "[![\(.login)](\(.avatar_url)&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

0 commit comments

Comments
 (0)