From bc4d797dea7aba1af1076a1854d67f038e150200 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Sun, 2 Jun 2024 12:22:48 +0000 Subject: [PATCH] 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) --- .github/workflows/CI.yml | 8 +++++++- package.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3cb0adba7a..babc2b471c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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: @@ -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 diff --git a/package.json b/package.json index c6da54187f..953b53f0e9 100644 --- a/package.json +++ b/package.json @@ -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",