From 1697d269a31450fa64dfdc95fb114cc4fdb04709 Mon Sep 17 00:00:00 2001 From: Roger Tuan <11964962+arcataroger@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:00:07 -0800 Subject: [PATCH] Add Github Action for the table of contents --- .github/workflows/regenerate-toc.yml | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/regenerate-toc.yml diff --git a/.github/workflows/regenerate-toc.yml b/.github/workflows/regenerate-toc.yml new file mode 100644 index 0000000..c0e57ca --- /dev/null +++ b/.github/workflows/regenerate-toc.yml @@ -0,0 +1,29 @@ +name: Regenerate Table of Contents + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm i -g doctoc # Install DocToc https://www.npmjs.com/package/doctoc + - run: doctoc README.md # Process the file and regenerate its ToC +