-
Notifications
You must be signed in to change notification settings - Fork 4
55 lines (46 loc) · 1.62 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: update
on:
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write # This is required for actions/checkout
pull-requests: write # For actions/github-script
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies
run: |
npm ci
- name: Update Leo
id: update-leo
run: |
npm run update-leo
- name: Rebuild Icons
id: build-icons
run: |
rm -rf symbols/
npm run gen-sf-symbols
- name: Check for modified symbols
id: check-symbols
run: echo modified=$(`git status --porcelain | grep -q symbols` && echo true || echo false) >> $GITHUB_OUTPUT
- name: Commit & Push Changes
if: steps.check-symbols.outputs.modified == 'true'
run: |
npm --no-git-tag-version version patch
git config --global user.name 'github-actions'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add -A
git commit -m "[Automated] Update Icons"
git push