From 5c34062544d5226aabb3ae8d562a6c6ccaf074d0 Mon Sep 17 00:00:00 2001 From: glennsl Date: Sun, 19 Feb 2023 16:44:14 +0100 Subject: [PATCH 1/2] chore(ci): add style check workflow --- .github/workflows/style.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/style.yml diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 00000000..e2df6854 --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,20 @@ +name: Style Check + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 19 + uses: actions/setup-node@v3 + with: + node-version: 19 + - run: npm install + - run: npx rescript format -all -check From 9bfb787b20cfc1e167729663560375d91e645c57 Mon Sep 17 00:00:00 2001 From: glennsl Date: Sun, 19 Feb 2023 20:25:39 +0100 Subject: [PATCH 2/2] chore(ci/style): show helpful error message on failure --- .github/workflows/style.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index e2df6854..f915e3df 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -18,3 +18,6 @@ jobs: node-version: 19 - run: npm install - run: npx rescript format -all -check + - name: Helpful error message + if: failure() + run: echo "::error::Incorrect formatting. Please run 'npx rescript format -all' and commit the changes."