-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (41 loc) · 1.28 KB
/
sync.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
name: Sync Enum
on:
workflow_dispatch: {}
schedule:
# https://crontab.guru/#0_9_*_*_1
# At 09:00 on Monday.
- cron: "0 9 * * 1"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.ACTION_DEPLOY_KEY }}
# waiting on: https://github.com/actions/setup-node/issues/531
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "yarn"
- run: yarn install --immutable
- run: yarn sync
- name: git config
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "actions@github.com"
- name: git commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BRANCH="chore/sync-$(date +%s)"
MESSAGE="feat: sync with latest Postgres Errors"
# UNCOMMENT FOR TESTING #
# echo "// test for ${BRANCH}" >> src/PostgresError.ts
git checkout -b ${BRANCH}
git add src/PostgresError.ts
if [[ `git status --porcelain` ]]; then
git commit --message "${MESSAGE}"
git push -u origin ${BRANCH}
gh pr create --title "${MESSAGE}" --body ""
fi