diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..59c2d008 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,20 @@ +name: Format +on: + pull_request: +jobs: + format: + name: Format docs + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install + uses: bahmutov/npm-install@v1 + - name: Generate TOC + run: npm run toc + - name: Commit changes + run: | + git config --global user.name 'Denys Dovhan' + git config --global user.email 'denysdovhan@gmail.com' + git commit -am "Update TOC" + git push diff --git a/package.json b/package.json index c07194cb..ea915c07 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ }, "scripts": { "precommit": "lint-staged", - "toc": "doctoc --github --title '# Table of Contents' --maxlevel 2 README.md", + "toc": "doctoc --github --title '# Table of Contents' --maxlevel 2 README*.md", "format": "prettier --write '*.{json,js}'" }, "repository": {