-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (40 loc) · 1.25 KB
/
simkl-recently-watched.yml
File metadata and controls
51 lines (40 loc) · 1.25 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
name: 🎬 Update Recently Watched
on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: profile-readme-assets
cancel-in-progress: false
jobs:
update-recently-watched:
name: Fetch Simkl history & generate SVG
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Generate recently-watched SVG
env:
SIMKL_CLIENT_ID: ${{ secrets.SIMKL_CLIENT_ID }}
SIMKL_ACCESS_TOKEN: ${{ secrets.SIMKL_ACCESS_TOKEN }}
run: node .github/scripts/generate-recently-watched.mjs
- name: Commit & push if changed
run: |
if git diff --quiet; then
echo "No changes to commit."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add assets/generated/recently-watched.svg
git commit -m "chore(readme): update recently watched"
git pull --rebase origin main
git push origin HEAD:main