toc of discussions #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: toc of discussions | |
on: | |
discussion: | |
types: | |
- created | |
permissions: | |
contents: write | |
discussions: read | |
jobs: | |
update-readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install Dependencies | |
run: | | |
pip install requests | |
- name: Update README | |
run: python .github/scripts/toc.py | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
- name: Push README | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Update README with a new discussion" | |
git push |