mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-20 23:08:50 +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:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prettier:
|
prettier:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: "Checkout repository's previous and current states"
|
||||||
# Need node to install prettier plugin(s)
|
uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
ref: ${{ github.head_ref }}
|
||||||
- run: npm ci
|
fetch-depth: 0
|
||||||
- run: |
|
persist-credentials: false
|
||||||
echo "Prettier-ing files"
|
|
||||||
npx prettier "src/**/*.{js,jsx}" --check
|
- 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