Skip to content

Migrate from pre-commit.ci to GitHub Action #2

Migrate from pre-commit.ci to GitHub Action

Migrate from pre-commit.ci to GitHub Action #2

Workflow file for this run

name: 'Maintenance: Format w/ Prettier'
on:
pull_request:
branches: ['master']
jobs:
prettier:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v4'
with:
# Make sure the actual branch is checked out when running on pull requests
ref: '${{ github.head_ref }}'
# This is important to fetch the changes to the previous commit
fetch-depth: 0
- uses: 'actions/setup-node@v4'
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: './package-lock.json'
- run: 'npm clean-install'
- uses: 'creyD/[email protected]'
with:
# This part is also where you can pass other options, for example:
prettier_options: '--write'
only_changed: true