s4: statistics: ch10: student-practices: ex10.11 #1
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: Generate TOC | |
on: | |
push: | |
branches: | |
- main | |
- ci/* | |
workflow_dispatch: | |
permissions: | |
contents: write | |
concurrency: | |
group: "toc" | |
cancel-in-progress: true | |
jobs: | |
toc-generate-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Set up authors | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Generate TOC | |
run: bash generate-toc.sh | |
- name: Commit and Push TOC | |
run: | | |
if [[ -z $(git status -s TOC.md) ]]; then | |
echo "No changes to TOC" | |
exit 0 | |
fi | |
git add TOC.md | |
git commit -m "toc: Update to $GITHUB_SHA" | |
git push |