diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 0000000..09f686c --- /dev/null +++ b/.github/workflows/prettier.yml @@ -0,0 +1,34 @@ +name: Code Formatting Check + +on: + pull_request: + branches: [main] + push: + branches: [main] + +jobs: + format-check: + name: Prettier Check + runs-on: ubuntu-latest + defaults: + run: + working-directory: auto-kol/agent + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'yarn' + cache-dependency-path: 'auto-kol/agent/yarn.lock' + + - name: Install Dependencies + run: yarn install --frozen-lockfile + + - name: Check Formatting + run: yarn prettier --check "src/**/*.ts" + + - name: Check ESLint + run: yarn eslint . --ext .ts diff --git a/auto-kol/agent/package.json b/auto-kol/agent/package.json index 58156f5..b7a0e0c 100644 --- a/auto-kol/agent/package.json +++ b/auto-kol/agent/package.json @@ -8,7 +8,8 @@ "build": "tsc", "start": "node dist/index.js", "dev": "tsx watch src/index.ts", - "format": "prettier --write \"src/**/*.ts\"" + "format": "prettier --write \"src/**/*.ts\"", + "format:check": "prettier --check \"src/**/*.ts\"" }, "dependencies": { "@autonomys/auto-dag-data": "^1.0.12",