Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
[add] Auto Format in GitHub actions
Browse files Browse the repository at this point in the history
[optimize] upgrade to PNPM v9 & Husky v9
  • Loading branch information
TechQuery committed Apr 30, 2024
1 parent edc00d7 commit c026cdc
Show file tree
Hide file tree
Showing 5 changed files with 4,086 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/WebPageToMarkdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
ignoreSelector: '.ad-wrapper'
markDownFilePath: './chinese/articles/'
githubToken: ${{ github.token }}

- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
name: CI & CD

on:
push:
branches:
- main

jobs:
Lint:
Lint-and-Format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install & Lint
run: |
npm install
npm run lint
cache: pnpm
- name: Install Dependencies
run: pnpm i --frozen-lockfile

- name: Lint & Format
run: pnpm format

- uses: stefanzweifel/git-auto-commit-action@v5
4 changes: 0 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
#!/usr/bin/env sh

. "$(dirname -- "$0")/_/husky.sh"

npm test
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
},
"devDependencies": {
"@lint-md/cli": "^2.0.0",
"husky": "^8.0.3",
"lint-staged": "^13.3.0",
"prettier": "^3.0.3"
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5"
},
"prettier": {
"singleQuote": true,
Expand All @@ -28,6 +28,6 @@
"lint": "lint-md chinese/**/*.md",
"format": "lint-md chinese/**/*.md --fix",
"test": "lint-staged",
"prepare": "husky install"
"prepare": "husky"
}
}
Loading

0 comments on commit c026cdc

Please sign in to comment.