Skip to content

Commit

Permalink
ci: add format workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
uncenter committed Aug 14, 2023
1 parent 91a74ca commit 535d411
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Format

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
format:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: .node-version
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: pnpm install --dev

- name: Format
run: pnpm run format

- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: "style: fmt"
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
{
"files": "**/*.{yml,yaml}",
"options": {
"singleQuote": false
"singleQuote": false,
"tabWidth": 2
}
}
]
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"cspell": "^7.0.0",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"prettier": "^3.0.1",
"prettier-plugin-tailwindcss": "^0.5.2",
"rimraf": "^5.0.1"
},
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 535d411

Please sign in to comment.