-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (40 loc) · 1.6 KB
/
Copy pathupdate.yml
File metadata and controls
46 lines (40 loc) · 1.6 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
name: Update model data
on:
schedule:
- cron: '0 4 * * *' # Runs every 24 hours
workflow_dispatch: # Allow manual trigger
jobs:
update-releases:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v6
with:
ref: data
- name: Fetch repository details
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -s -H "Authorization: Bearer $GH_TOKEN" \
"https://api.github.com/repos/redasm-dev/redasm" > repository.json
- name: Fetch releases
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -s -H "Authorization: Bearer $GH_TOKEN" \
"https://api.github.com/repos/redasm-dev/redasm/releases" > releases.json
- name: Fetch CI status
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -s -H "Authorization: Bearer $GH_TOKEN" \
"https://api.github.com/repos/redasm-dev/workspace/actions/workflows/ci.yml/runs?per_page=10" > ci.json
curl -s -H "Authorization: Bearer $GH_TOKEN" \
"https://api.github.com/repos/redasm-dev/workspace/actions/workflows/nightly.yml/runs?per_page=10" > nightly.json
- name: Push updates to data branch
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add repository.json releases.json ci.json nightly.json
git commit -m "chore: update model" || echo "No changes to commit"
git push -f origin data