-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.6 KB
/
merge.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
name: Merge records to table
# when multiple jobs run at the same time, first N pipelines will be cancelled, this may send lots of email (cannot turn off)
# concurrency:
# group: ${{ github.ref }} # github.ref="refs/heads/main"
on:
workflow_dispatch: # manually trigger pipeline
push: # When client modify table record files in table dir
paths:
- '*/*/*/*.json' # dbs/iam/users/123.json
jobs:
merge-records:
name: Merge records into table file (table file is modified, repo is dirty now)
runs-on: ubuntu-latest
# concurrency:
# group: merge
# cancel-in-progress: true
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Merge records
run: npx @db-man/cli dbs merge
- name: git status
run: |
git status
git diff
# git pull # this will make sure local update to date
- name: Commit files
run: |
git config --local user.name "github-actions[bot]"
git commit -am "[CI] Merge records to table"
- name: Push changes
uses: ad-m/github-push-action@master
# when multiple jobs run at the same time, only last git push will sucess, then other pipelines will fail and send email.
# to prevent get lots of email notification, use `continue-on-error` to make pipeline success even the git push failed.
continue-on-error: true
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}