Skip to content

Commit

Permalink
feat(ci): auto format code
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Aug 5, 2023
1 parent 77acead commit dcf9ba9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Format

on:
push:
branches: [main]

jobs:
format:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: pnpm install

- name: Format
run: pnpm run format

- name: Add, Commit and Push
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "style: format code with prettier"
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"url": "https://www.nn.ci"
},
"description": "The front end of Alist V3",
"packageManager": "pnpm@8.6.10",
"repository": {
"type": "git",
"url": "git+https://github.com/alist-org/alist-web.git"
Expand All @@ -28,7 +29,8 @@
"dev": "vite",
"build": "vite build",
"serve": "vite preview",
"prepare": "husky install"
"prepare": "husky install",
"format": "prettier --ignore-path .gitignore -w \"src/**/*.{js,ts,json,css,tsx,jsx}\""
},
"license": "MIT",
"devDependencies": {
Expand Down

0 comments on commit dcf9ba9

Please sign in to comment.