We can improve our team workflow by defining some git hooks that trigger on specified events.
You can read all events and their usecases here : https://www.digitalocean.com/community/tutorials/how-to-use-git-hooks-to-automate-development-and-deployment-tasks
$ ln pre-commit .git/hooks/pre-commit
pre-commit file :
echo 'Running pre-commit hook'
git add README.md
So it will run a Python script that update new TOC and then add the file to git.
Automation ! Automation ! AND .... Automation !!! 🤖