diff --git a/.github/actions/md-toc/action.yml b/.github/actions/md-toc/action.yml index c236ae9e8..1312100ee 100644 --- a/.github/actions/md-toc/action.yml +++ b/.github/actions/md-toc/action.yml @@ -26,6 +26,12 @@ inputs: description: Bullets to use for Table of Contents ("*", "-" or "+") required: false default: '*' + no_toc_in_toc: + description: >- + Do not include Table of Contents heading in Table of Contents + (Assuming it's the first h1/##) + required: false + default: 'true' node_version: description: Node.js version to install (false means do not install) required: false @@ -43,8 +49,10 @@ runs: - name: Generate Table of Contents env: MDTOC_IARG: ${{ inputs.dry_run == 'false' && '-i' || '' }} + MDTOC_HARG: ${{ inputs.no_toc_in_toc == 'true' && '--no-firsth1' || '' }} + MDTOC_ARGS: ${{ env.MDTOC_IARG }} ${{ env.MDTOC_HARG }} run: | - markdown-toc "$MDTOC_IARG" \ + markdown-toc "$MDTOC_ARGS" \ --maxdepth "${{ inputs.depth }}" \ --bullets "${{ inputs.bullets }}" \ --append "${{ inputs.append }}" \