-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |