Update update_readme.yaml #5
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: Update README with Markdown Links | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
update-readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Extract Markdown links and update README | |
run: | | |
find docs -type f -name "*.md" -exec awk -v RS= '{gsub(/\n/, " "); print "[" FILENAME "](" FILENAME ")"}' {} \; > links.txt | |
awk 'BEGIN{p=1} /^## Notes/{print "## Notes"; system("cat links.txt"); p=0} p' README.md > temp_readme.md | |
mv temp_readme.md README.md | |
- name: Commit and push changes | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "[email protected]" | |
git add README.md | |
git commit -m "Update README with documentation links" | |
git push |