Closed DougLeonard closed 1 year ago
:raised_hands: Thanks for opening your first issue here! Be sure to follow the issue template!
I'm just learning my way around github actions. So I found a simple enough solutions by just rolling my own workflow instead.
A draft of that looks like this:
on: push
name: TOC Action
jobs:
doDOCTOC:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: |
npm install -g doctoc
- name: Run DODCTOC
run: |
doctoc .
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Auto update markdown TOC
It's slow, isn't using lockfile caching, but it does work, and it does ignore \ as expected.
Describe the bug
Files with \ at top are not skipped.
To Reproduce
1) add a markdown file like Home.md with \ as the first line
2) use following for .github/workflows/toc.yml:
3) push to github
4) TOCs are added to all .md files, including Home.md
Expected behavior:
A TOC is not automatically added to Home.md
Additional context:
running
from the local clone produces the expected behavior, indicating that the comment tag is inserted correctly.
Maybe there is a difference is doctoc versions? Or I'm doing it wrong?
Edited toc.yml above, tested with both v3 and v4.