diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml new file mode 100644 index 000000000..5fec18001 --- /dev/null +++ b/.github/workflows/autofix.yml @@ -0,0 +1,33 @@ +name: autofix.ci +on: + pull_request: + types: [review_requested, ready_for_review] + push: + branches: ['main'] +permissions: + contents: read + +jobs: + autofix: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v3 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + cache: 'pnpm' + node-version: '20' + + - run: pnpm install + + - name: Run ESLint + run: pnpm fix + + - name: Run Prettier + run: pnpm format + + - uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a diff --git a/package.json b/package.json index 3342c1717..e8a6190ba 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "check:format": "prettier . --check", "check:types": "dotenv -e .env.local -- turbo run check --cache-dir=.turbo", "check:lint": "eslint . --ext .ts,.tsx --ignore-path .gitignore", - "check": "pnpm check:format && pnpm check:lint && pnpm check:types", + "check": "pnpm check:lint && pnpm check:types", + "fix": "eslint --fix . --ext .ts,.tsx --ignore-path .gitignore", "build:all": "dotenv -e .env.local -- turbo run build --cache-dir=.turbo", "build": "pnpm run -r build", "build:ee": "pnpm run -r ee:build",