diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c43720c9..4f600cf3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,20 +1,25 @@ name: Lint -on: push +on: + pull_request: + push: + branches: + - main jobs: - lint: - name: Lint (Prettier) + prettier: + name: Prettier runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 + with: + # Make sure the actual branch is checked out when running on pull requests + ref: ${{ github.head_ref }} - - name: Setup Node.js - uses: actions/setup-node@v3 - - - name: Install dependencies - run: npm ci --no-scripts - - - name: Run prettier - run: npx prettier -c . + - name: Prettify code + uses: creyD/prettier_action@v4.3 + with: + only_changed: True + commit_message: "(lint): Run prettier against ${{ github.sha }}" + prettier_options: "--write ."