From bf58ca1510e865149c46abb16e36744d242a158b Mon Sep 17 00:00:00 2001 From: sunshinesmilelk <1176136681@qq.com> Date: Wed, 9 Oct 2024 22:16:25 +0800 Subject: [PATCH] feat: support bilingual toc title --- .github/workflows/toc.yml | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/toc.yml b/.github/workflows/toc.yml index d00e7fb38..096fa6aba 100644 --- a/.github/workflows/toc.yml +++ b/.github/workflows/toc.yml @@ -5,14 +5,33 @@ on: - main - ximo_dev paths: - - 'README.md' # 只有 README.md 发生变化时触发name: TOC Generator + - README.md + - README_zh.md jobs: generateTOC: name: TOC Generator runs-on: ubuntu-latest steps: - - uses: technote-space/toc-generator@v4 + # - uses: technote-space/toc-generator@v4 + # with: + # CREATE_PR: true + # GITHUB_TOKEN: ${{ secrets.LIBRO_TOKEN }} + # PR_TITLE: 'chore(docs): update TOC of readme' + - name: Print modified files + run: | + echo "Modified files in the last commit:" + echo "${{ toJson(github.event.head_commit.modified) }}" + + - name: Generate TOC for README.md + if: contains(github.event.head_commit.modified, 'README.md') + uses: technote-space/toc-generator@v4 with: - CREATE_PR: true - GITHUB_TOKEN: ${{ secrets.LIBRO_TOKEN }} - PR_TITLE: 'chore(docs): update TOC of readme' + path: README.md + title: '## Table of Contents' + + - name: Generate TOC for README_zh.md + if: contains(github.event.head_commit.modified, 'README_zh.md') + uses: technote-space/toc-generator@v4 + with: + path: README_zh.md + title: '## 目录'