-
Notifications
You must be signed in to change notification settings - Fork 200
47 lines (37 loc) · 1.23 KB
/
auto-update.yml
File metadata and controls
47 lines (37 loc) · 1.23 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
name: Auto Update
on:
pull_request:
paths:
- 'repos.csv'
permissions:
contents: write
pull-requests: write
jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # Fetch all history for proper diff
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Fetch base branch
run: git fetch origin ${{ github.base_ref }}
- name: Run update README script
run: node scripts/update-readme.js
- name: Generate updates from diff
run: node scripts/generate-update-from-diff.js
- name: Commit and push if changed
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add README.md data/updates.json public/rss.xml
# Check if there are changes
if ! git diff --staged --quiet; then
git commit -m "chore: auto-update README, updates and RSS from repos.csv"
git push origin HEAD:${{ github.head_ref }}
fi