Skip to content

Commit

Permalink
feat: Add format workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
denysdovhan committed Feb 3, 2021
1 parent 2d6d861 commit c36b046
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -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 '[email protected]'
git commit -am "Update TOC"
git push
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit c36b046

Please sign in to comment.