Skip to content

Commit

Permalink
Refactor code to improve performance and readability
Browse files Browse the repository at this point in the history
  • Loading branch information
mijanr committed Mar 16, 2024
1 parent 509a55d commit a69538f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/update_readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ jobs:
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)
# Insert new content at line 57
updated_readme_content=$(awk -v content="$content" 'NR == 57 {print content} {print}' 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-->"
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
Expand Down

0 comments on commit a69538f

Please sign in to comment.