diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..a8a7b15a --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,24 @@ +name: Format Check + +on: [push] + +env: + PUBLIC_SUPABASE_URL: 'https://fake_test_url.supabase.co' + PUBLIC_SUPABASE_ANON_KEY: 'fake_anon_key' + PRIVATE_SUPABASE_SERVICE_ROLE: 'fake_service_role' + PRIVATE_STRIPE_API_KEY: 'fake_strip_api_key' + PUBLIC_SITE_NAME: 'SaaS Starter Build Test' + +jobs: + build_and_test: + name: Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: NPM install + run: npm install + + - name: Check Code Format + run: npm run format_check diff --git a/README.md b/README.md index aca6701d..cf94a9db 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # SaaS Starter [![Build](https://github.com/CriticalMoments/CMSaasStarter/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/CriticalMoments/CMSaasStarter/actions/workflows/build.yml) +[![Format Check](https://github.com/CriticalMoments/CMSaasStarter/actions/workflows/format.yml/badge.svg?branch=main)](https://github.com/CriticalMoments/CMSaasStarter/actions/workflows/format.yml) [![License](https://img.shields.io/badge/License-MIT-brightgreen?labelColor=32383f)](https://github.com/CriticalMoments/CMSaasStarter/blob/main/LICENSE) ### SaaS Starter is an open source, fast, and free to host SaaS template / boilerplate diff --git a/package.json b/package.json index 94d198b2..c7f7a945 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch", "test": "vitest", "lint": "eslint .", - "format": "prettier --write --plugin prettier-plugin-svelte ./src" + "format": "prettier --write --plugin prettier-plugin-svelte ./src", + "format_check": "prettier --check --plugin prettier-plugin-svelte ./src" }, "devDependencies": { "@sveltejs/adapter-auto": "^2.0.0",