Skip to content

Commit bc4d797

Browse files
authored
ci: add schedule&workflow_dispatch triggers (#4087)
* ci: add schedule&workflow_dispatch triggers The schedule trigger will run CI everyday to make sure we catch any breakage caused by external reasons. The workflow_dispatch one is so that the repo owner can launch CI jobs manually. * ci(prettier): rather use --check instead of -l Not sure why -l flag sometimes make command fail when it shouldn't. * ci: make format failure clearer * ci: fix YML format (prettier)
1 parent 76e148e commit bc4d797

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/CI.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
pull_request:
88
types: [opened, synchronize]
99

10+
workflow_dispatch:
11+
12+
# to execute once a day (more info see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule )
13+
schedule:
14+
- cron: '0 0 * * *'
15+
1016
jobs:
1117
build:
1218
strategy:
@@ -47,7 +53,7 @@ jobs:
4753
run: yarn install --ignore-engines --frozen-lockfile
4854

4955
- name: Check format
50-
run: yarn format
56+
run: yarn format || (yarn format-fix; git diff --exit-code)
5157

5258
- name: Lint
5359
run: yarn lint

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"docs-preview": "vitepress preview docs",
1818
"lint": "eslint . --ext .js,.ts",
1919
"lint-fix": "eslint . --ext .js,.ts --fix",
20-
"format": "prettier **/*.{ts,js,json,yml,md} -l",
20+
"format": "prettier **/*.{ts,js,json,yml,md} --check",
2121
"format-fix": "prettier **/*.{ts,js,json,yml,md} --write",
2222
"publish": "lerna publish --conventional-commits",
2323
"reinstall": "yarn clean && yarn install",

0 commit comments

Comments
 (0)