Golang-tutorial
Golang-tutorial copied to clipboard
📚 Documentation: Update index in README.md add links for updated files and folder
💬 Description
- [ ] add all the links for notes and main.go files that were added recently and not present in readme
you can take reference from this readme
👀 Have you spent some time to check if this issue has been raised before?
- [X] I checked and didn't find similar issue
🔖 Have you read the Code of Conduct?
- [X] Please search to see if an issue already exists for the bug or typo error you wanna add.
@SagarSingh2003, can we use github actions to auto update README.md file whenever there is a merge into main branch
@SagarSingh2003, can we use github actions to auto update README.md file whenever there is a merge into main branch
great idea @bvvnmanikanta !! please go ahead and raise an issue for it ^^ .
@SagarSingh2003, can we use github actions to auto update README.md file whenever there is a merge into main branch
@bvvnmanikanta how will you proceed with this? How action will know which part of Readme needs update?
I don't mean to scare you with these questions just curious to know do you have any approach or you'll do research on it
@Yashsharma1911, I checked an article that discussed dynamically updating the readme.md file. PFB sample code for updating the readme file with files list.
name: Update README
on:
repository_dispatch:
types: update-readme
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Generate file list
run: |
files=""
for dir in */; do
if [ -d "$dir" ]; then
files+="- [$dir]($dir)\n"
for file in "$dir"/*; do
if [ -f "$file" ]; then
filename=$(basename "$file")
files+=" - [$filename]($dir$filename)\n"
fi
done
fi
done
sed -i "s|<!-- FILE_LIST -->|$files|" README.md
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "Update main README.md with file links"
git push
Still need to work on it.
if that is the case @bvvnmanikanta please go ahead ^^