-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (64 loc) · 1.79 KB
/
Copy pathsync.yml
File metadata and controls
77 lines (64 loc) · 1.79 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Sync
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
concurrency:
group: sync
cancel-in-progress: true
permissions:
contents: write
jobs:
commit:
runs-on: ubuntu-latest
outputs:
update: ${{ steps.check.outputs.update }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: Update submodule
run: git submodule update --remote
- name: Check status
id: check
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "update=true" >> $GITHUB_OUTPUT
else
echo "update=false" >> $GITHUB_OUTPUT
fi
- name: Commit changes
if: steps.check.outputs.update == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add ejs
git commit -m "chore(main): sync with ejs"
git push origin main
update:
needs: commit
if: needs.commit.outputs.update == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v5
- name: Sync dependencies
run: npm run sync:deps
- name: Commit changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add package.json
git commit -m "chore(deps): sync with ejs"
git push origin main
else
exit 0
fi