-
Notifications
You must be signed in to change notification settings - Fork 99
41 lines (35 loc) · 1.19 KB
/
collections-update.yml
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
name: Create PR to update collections
on:
schedule:
# run once a day, 6am
- cron: '0 6 * * *'
jobs:
update-collection:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js LTS
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: 🧰 Install dependencies
working-directory: scripts
run: npm install
- name: 🦫 Run update collections
working-directory: scripts
run: node updateCollections.js
- name: 🆕 Add changes to collections
env:
GH_TOKEN: ${{ github.token }}
run: |
if ! [ -z "$(git status --porcelain)" ]; then
#gib access
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git checkout -b $(date +'%Y-%m-%d')-update-collections
git add static/collections.json
git commit -m "static: update collections.json"
git push -u origin $(date +'%Y-%m-%d')-update-collections
gh pr create --title "Update collections $(date +'%m-%d')" --base main --body 'Created by Github Actions'
fi