+++ /dev/null
-name: "Auto remark-lint"
-
-on:
- pull_request:
- paths:
- - 'docs/**'
-
-jobs:
- build:
- name: "Auto remark-lint"
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: 2
- - name: "Install deps"
- uses: actions/setup-node@v1
- with:
- node-version: '12.x'
- - name: Cache dependencies
- uses: actions/cache@v1
- with:
- path: ~/.npm
- key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-node-
-
- - name: Cache install
- uses: actions/cache@v1
- with:
- path: ./node_modules
- key: ${{ runner.os }}-dep-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-dep-
- - run: npm install .
- - run: npm install remark-cli
- - name: "Format files"
- run: remark ./docs -o --silent
- - name: Commit files
- run: |
- git config --local user.email "15963390+24OI-bot@users.noreply.github.com"
- git config --local user.name "24OI-bot"
- git add ./docs
- git commit -m 'style: format markdown files with remark-lint'
- - name: Push changes
- run: |
- git remote add token https://${GITHUB_ACTOR}:${{ secrets.BOT_PUSH_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git
- git push token HEAD:${GITHUB_REF}