Skip to content

Update README.md with best_runs content #27

Update README.md with best_runs content

Update README.md with best_runs content #27

Workflow file for this run

name: Update Best Runs
on:
push:
branches:
- test # Change this to your main branch name if different
jobs:
update_best_runs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Read Best Runs Content
id: read_best_runs
run: |
# Read the content of best_runs.md file
content=$(cat results/best_runs.md)
echo "Content from best_runs.md:"
echo "$content"
- name: Update README.md
run: |
# Read the content of README.md
readme_content=$(cat README.md)
# Define line number to insert content (line 57 in this case)
line_number=57
# 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-->"
# Insert new content at the specified line number
updated_readme_content=$(awk -v content="$new_content" -v line="$line_number" 'NR == line {print content} {print}' README.md)
# Update README.md
echo "$updated_readme_content" > README.md
# 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