Try add prettier

This commit is contained in:
yuhan6665
2025-12-24 20:54:13 -05:00
parent 8c07418ddf
commit 7badf94385
3 changed files with 45 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
name: Prettier Action
on:
pull_request:
branches: [main]
permissions:
contents: write
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
if: github.event.pull_request.head.repo.full_name == 'XTLS/Xray-docs-next'
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
- name: Checkout
if: github.event.pull_request.head.repo.full_name != 'XTLS/Xray-docs-next'
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Prettify code
if: github.event.pull_request.head.repo.full_name == 'XTLS/Xray-docs-next'
uses: creyD/prettier_action@v4.6
with:
prettier_options: --write **/*.{js,ts,md,vue}
- name: Prettify code dry run
if: github.event.pull_request.head.repo.full_name != 'XTLS/Xray-docs-next'
uses: creyD/prettier_action@v4.6
with:
prettier_options: --write **/*.{js,ts,md,vue}
only_changed: true
dry: true
+1
View File
@@ -0,0 +1 @@
node_modules/
+10
View File
@@ -0,0 +1,10 @@
{
overrides: [
{
files: ['**/*.jsonc', '**/*.md'],
options: {
trailingComma: 'none',
}
}
]
}