diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f523e49 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI +on: + pull_request: + branches: + - master + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Checkout + uses: actions/checkout@v2 + + # @coding-operation/public-component-web is a private package. + # remove all packages, or install would fail. + - name: Prepare + run: | + rm package.json yarn.lock + yarn add lint-md-cli remark-cli remark-preset-lint-recommended fnlint + + - name: Get Diff Action + uses: technote-space/get-diff-action@v4.0.1 + with: + PATTERNS: | + source/**/*.md + *.md + + - name: Lint + if: env.GIT_DIFF + run: | + yarn remark -f ${{ env.GIT_DIFF }} + yarn lint-md ${{ env.GIT_DIFF }} + yarn fnlint -c .fnlint.json diff --git a/README.md b/README.md index de2682f..8058715 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # CODING 帮助中心 +[](https://github.com/Coding/coding-docs/actions/workflows/ci.yml) [](http://commitizen.github.io/cz-cli/) 本仓库是 CODING 帮助中心的文档,采用 Hexo 框架,Markdown 格式,通过持续集成强制检查下列规范: