mirror of
https://github.com/LouisShark/chatgpt_system_prompt.git
synced 2025-07-06 23:00:34 -04:00
37 lines
No EOL
934 B
YAML
37 lines
No EOL
934 B
YAML
name: Generate TOC on PR Merge
|
|
|
|
on:
|
|
pull_request_target:
|
|
types:
|
|
- closed
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
if_merged:
|
|
if: github.event.pull_request.merged == true
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python 3
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Run TOC generation script
|
|
run: |
|
|
chmod +x .scripts/idxtool.py
|
|
python3 .scripts/idxtool.py --toc
|
|
|
|
- name: Commit TOC updates
|
|
run: |
|
|
git config --global user.name 'LouisShark'
|
|
git config --global user.email 'mshark.louis@gmail.com'
|
|
git add .
|
|
git commit -m "docs: Update TOC.md" || echo "No changes to commit"
|
|
git pull --rebase
|
|
git push origin HEAD:main
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |