-
-
Notifications
You must be signed in to change notification settings - Fork 99
64 lines (52 loc) · 1.62 KB
/
sync-templates.yml
File metadata and controls
64 lines (52 loc) · 1.62 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
name: Sync Templates
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * MON'
concurrency:
group: sync-templates
cancel-in-progress: true
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
env:
NODE_VERSION: 22
steps:
- name: Check out code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Update template dependencies
run: pnpm update:templates:deps
- name: Configure SSH
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.TEMPLATE_SYNC_SSH_KEY }}
- name: Sync templates upstream
env:
GIT_AUTHOR_NAME: 'github-actions[bot]'
GIT_AUTHOR_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com'
GIT_COMMITTER_NAME: 'github-actions[bot]'
GIT_COMMITTER_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com'
run: pnpm push:templates
- name: Commit monorepo changes
run: |
if [[ -n $(git status --porcelain) ]]; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "chore: sync templates"
git push
fi