Update README with new content #7
Workflow file for this run
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 best runs | |
on: | |
push: | |
branches: | |
- test | |
jobs: | |
update_readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 # Update to the latest version | |
- name: Extract content from best_runs.md | |
id: extract_best_runs # Add an 'id' for later referencing | |
run: | | |
sed -n '//, //p' results/best_runs.md > extracted_content.md | |
- name: Update README | |
run: | | |
new_content="$(cat extracted_content.md)" | |
if [[ -n "${new_content}" ]]; then | |
# Replace existing section with new content | |
sed -i '//,//c\\n'"${new_content}"'\n' README.md | |
# Commit changes to README.md | |
git config user.name "Md Mijanur Rahman" | |
git config user.email "[email protected]" | |
git add README.md | |
git commit -m "Automatic update: Best runs section" | |
git push | |
else | |
echo "No changes in best_runs.md; update skipped" | |
fi |