diff --git a/.github/workflows/biome-linting.yml b/.github/workflows/biome-linting.yml deleted file mode 100644 index a80d5f5f0..000000000 --- a/.github/workflows/biome-linting.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Biome Linting - -on: - push: - pull_request: - -jobs: - quality: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - - - name: Setup Biome - uses: biomejs/setup-biome@1cbe33ead22c7a2fded3b52fa2893611c815c9b5 # v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Run Biome - run: biome ci . \ No newline at end of file diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 000000000..af60539dd --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,44 @@ +name: 'Format Code' + +on: + workflow_dispatch: + push: + branches: + - main + +permissions: + contents: write + +jobs: + format: + runs-on: ubuntu-latest + env: + NODE_OPTIONS: "--max_old_space_size=4096" + steps: + - name: Check out code using Git + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup PNPM + uses: pnpm/action-setup@v3 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: '.node-version' + cache: pnpm + - name: Install dependencies + run: pnpm ci:install + shell: bash + + - name: Format code + run: pnpm run lint:fix + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: '[ci] lint' + branch: ${{ github.head_ref }} + commit_user_name: astrolicious + commit_user_email: no-reply@studiocms.xyz + commit_author: StudioCMS