name: Prettier on: pull_request: push: branches: [main] jobs: prettier: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: # using the USERSTYLES_TOKEN for main (branch protection), # and general github.token for PRs token: ${{ github.ref == 'refs/heads/main' && secrets.USERSTYLES_TOKEN || github.token }} - name: Run prettier uses: actionsx/prettier@v2 with: args: "--write styles/**/*.css" - name: Push Changes uses: stefanzweifel/git-auto-commit-action@v4 if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' }} with: commit_message: "style: format code with prettier" commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" branch: ${{ github.ref }} # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json