mirror of
https://github.com/LouisShark/chatgpt_system_prompt.git
synced 2025-07-15 19:06:37 -04:00
33 lines
No EOL
920 B
YAML
33 lines
No EOL
920 B
YAML
name: Generate TOC on PR Merge
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
types: [closed]
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
run-script:
|
|
runs-on: ubuntu-latest
|
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event.pull_request.merged == true && github.base_ref == 'main')
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Run TOC generation script
|
|
run: |
|
|
chmod +x generate_toc_for_readme.sh
|
|
./generate_toc_for_readme.sh
|
|
|
|
- name: Commit TOC updates
|
|
run: |
|
|
git config --global user.name 'LouisShark'
|
|
git config --global user.email 'mshark.louis@gmail.com'
|
|
git add TOC.md
|
|
git commit -m "docs: Update TOC.md" || echo "No changes to commit"
|
|
git push origin HEAD:main
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |