diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml new file mode 100644 index 0000000..9b4c18e --- /dev/null +++ b/.github/workflows/autofix.yml @@ -0,0 +1,35 @@ +name: autofix.ci # For security reasons, the workflow in which the autofix.ci action is used must be named "autofix.ci". + +on: + pull_request: + types: + - opened + - synchronize + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + autofix: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup Node.js LTS + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: yarn + + - name: Install dependencies + run: yarn --immutable + + - name: Format Codes + run: yarn format + + - name: Apply autofix.ci + uses: autofix-ci/action@v1 + with: + fail-fast: false diff --git a/package.json b/package.json index 2c5bad3..f2161eb 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "build:r": "r -f cjs", "build:ts": "tsc -b", "eslint": "ESLINT_USE_FLAT_CONFIG=false eslint", + "format": "prettier --write .", "lint": "run-p 'lint:*'", "lint:es": "eslint . --cache", "lint:tsc": "tsc -b --noEmit",