diff --git a/.github/workflows/process-mdx.yml b/.github/workflows/process-mdx.yml new file mode 100644 index 00000000..9dc195da --- /dev/null +++ b/.github/workflows/process-mdx.yml @@ -0,0 +1,40 @@ +name: Process MDX Files + +on: + push: + branches: [ test-action ] # 仅在test-action分支上触发 + paths: + - '**.mdx' # 只在MDX文件变更时触发 + - 'tools/**' # 或工具脚本变更时触发 + workflow_dispatch: # 允许手动触发 + +jobs: + process-mdx: + runs-on: ubuntu-latest + permissions: + contents: write # 允许脚本修改和提交文件 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pyyaml + + - name: Run MDX processing script + run: python tools/1_rename_by_dimensions.py + + - name: Commit changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit -m "Auto-process MDX files [skip ci]" || echo "No changes to commit" + git push \ No newline at end of file