-
Notifications
You must be signed in to change notification settings - Fork 23
54 lines (46 loc) · 1.3 KB
/
update-views.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
name: Update views
on:
schedule:
- cron: '50 18 * * MON-FRI'
push:
branches:
- master
paths:
- '.github/update-views'
pull_request:
paths:
- 'package.json'
jobs:
update-views:
name: Update default EJS views
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
- name: Config Git user
run: |
git config --local user.email 'action@github.com'
git config --local user.name 'GitHub Action'
- name: Pull views subtree
continue-on-error: true
run: |
git subtree pull --prefix=template/pages --message="Merge views subtree" \
https://github.com/ecomplus/storefront-starter-views master --squash
- name: Checkout diff as ours
run: |
for file in ./template/pages/**
do
git checkout --ours $file -q
done
- name: Commit template pages
run: |
git add template/pages
git diff-index --quiet HEAD || git commit -m "fix(pages): update/merge default views"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master