mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-19 06:18:49 +01:00
Use creyD/prettier_action@v4.3
for auto-apply of prettier in pull requests
This commit is contained in:
parent
b724c4133e
commit
c270c87cfb
1 changed files with 15 additions and 8 deletions
23
.github/workflows/prettier-pr.yml
vendored
23
.github/workflows/prettier-pr.yml
vendored
|
@ -2,18 +2,25 @@ name: Prettier on pull requests
|
|||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
prettier:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
# Need node to install prettier plugin(s)
|
||||
- uses: actions/setup-node@v4
|
||||
- name: "Checkout repository's previous and current states"
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- run: npm ci
|
||||
- run: |
|
||||
echo "Prettier-ing files"
|
||||
npx prettier "src/**/*.{js,jsx}" --check
|
||||
ref: ${{ github.head_ref }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run prettier on the changed files"
|
||||
uses: creyD/prettier_action@v4.3 # https://github.com/creyD/prettier_action/blob/v4.3/entrypoint.sh
|
||||
with:
|
||||
prettier_options: >-
|
||||
--write
|
||||
**/*.{js,jsx}
|
||||
only_changed: true
|
||||
|
|
Loading…
Reference in a new issue