Skip to content

Commit

Permalink
Update best runs in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mijanr committed Mar 16, 2024
1 parent 0176919 commit 7912b3c
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/update_readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,28 @@ jobs:
run: |
# Read the content of best_runs.md file
content=$(cat results/best_runs.md)
#print the content
echo "$content"
echo "$content"
- name: Update README.md
run: |
# Read the content of README.md
readme_content=$(cat README.md)
# Replace content between <!--START_SECTION:best_runs--> and <!--END_SECTION:best_runs-->
new_content="<!--START_SECTION:best_runs--> \n $content \n <!--END_SECTION:best_runs-->"
new_content="<!--START_SECTION:best_runs-->\n$content\n<!--END_SECTION:best_runs-->"
updated_readme_content=$(echo "$readme_content" | sed -e '/<!--START_SECTION:best_runs-->/, /<!--END_SECTION:best_runs-->/c\'"$new_content")
# Update README.md
echo "$updated_readme_content" > README.md
# commit the changes if there are any changes
if [ -n "$(git status --porcelain)" ]; then
# Commit and push changes
git config --global user.name "Md Mijanur Rahman"
git config --global user.email "[email protected]"
git add README.md
git commit -m "Update best runs in README.md"
git push
else
echo "There are no changes in the README.md file"
fi
# Check if there are changes in README.md
if ! git diff --quiet README.md; then
# Commit and push changes
git config --global user.name "Md Mijanur Rahman"
git config --global user.email "[email protected]"
git add README.md
git commit -m "Update best runs in README.md"
git push
else
echo "There are no changes in the README.md file"
fi

0 comments on commit 7912b3c

Please sign in to comment.