From 1c330f403c401a5fd2ad334de112e77b9a18c81a Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sat, 22 Oct 2022 00:12:31 +0800 Subject: [PATCH] chore(gh-actions): add style-lint on CI --- .github/workflows/style-lint.yml | 22 ++++++++++++++++++++++ package.json | 4 ++++ 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/style-lint.yml diff --git a/.github/workflows/style-lint.yml b/.github/workflows/style-lint.yml new file mode 100644 index 0000000..f54f3c3 --- /dev/null +++ b/.github/workflows/style-lint.yml @@ -0,0 +1,22 @@ +name: 'Style Lint' + +on: + push: + paths: + - '_sass/**.scss' + pull_request: + paths: + - '_sass/**.scss' + +jobs: + stylelint: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + - run: npm i + - run: npm test diff --git a/package.json b/package.json index 58c8880..e42487c 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,10 @@ "url": "https://github.com/cotes2020/jekyll-theme-chirpy/issues" }, "homepage": "https://github.com/cotes2020/jekyll-theme-chirpy#readme", + "scripts": { + "test": "npx stylelint _sass/**/*.scss", + "fixlint": "npx stylelint _sass/**/*.scss --fix" + }, "devDependencies": { "gulp": "^4.0.2", "gulp-concat": "^2.6.1",