-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (51 loc) · 1.82 KB
/
Copy pathupdate-github-stars.yml
File metadata and controls
64 lines (51 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Update GitHub Stars
on:
schedule:
# Run every Monday at 00:00 UTC
- cron: '0 0 * * 1'
# Allow manual triggering from Actions tab
workflow_dispatch:
jobs:
update-stars:
name: Update GitHub Star Counts
runs-on: ubuntu-latest
permissions:
contents: write # Required for committing changes
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Update GitHub star counts
run: npm run update-stars
continue-on-error: false
- name: Check for changes
id: git-check
run: |
git diff --exit-code src/data/agents-detailed.json || echo "changes=true" >> $GITHUB_OUTPUT
- name: Configure Git
if: steps.git-check.outputs.changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit and push changes
if: steps.git-check.outputs.changes == 'true'
run: |
git add src/data/agents-detailed.json
git commit -m "chore: update GitHub star counts
Automated weekly update of star counts for open-source agents.
Updated: $(date -u +"%Y-%m-%d %H:%M UTC")"
git push
- name: Summary
run: |
echo "### GitHub Stars Update Complete ✓" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Run Date**: $(date -u +"%Y-%m-%d %H:%M UTC")" >> $GITHUB_STEP_SUMMARY
echo "**Changes Committed**: ${{ steps.git-check.outputs.changes || 'false' }}" >> $GITHUB_STEP_SUMMARY