Skip to content

Commit

Permalink
ci: add schedule&workflow_dispatch triggers (#4087)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
knocte authored Jun 2, 2024
1 parent 76e148e commit bc4d797
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ on:
pull_request:
types: [opened, synchronize]

workflow_dispatch:

# to execute once a day (more info see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule )
schedule:
- cron: '0 0 * * *'

jobs:
build:
strategy:
Expand Down Expand Up @@ -47,7 +53,7 @@ jobs:
run: yarn install --ignore-engines --frozen-lockfile

- name: Check format
run: yarn format
run: yarn format || (yarn format-fix; git diff --exit-code)

- name: Lint
run: yarn lint
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"docs-preview": "vitepress preview docs",
"lint": "eslint . --ext .js,.ts",
"lint-fix": "eslint . --ext .js,.ts --fix",
"format": "prettier **/*.{ts,js,json,yml,md} -l",
"format": "prettier **/*.{ts,js,json,yml,md} --check",
"format-fix": "prettier **/*.{ts,js,json,yml,md} --write",
"publish": "lerna publish --conventional-commits",
"reinstall": "yarn clean && yarn install",
Expand Down

0 comments on commit bc4d797

Please sign in to comment.