Skip to content

Commit

Permalink
Update README.md with best_runs content
Browse files Browse the repository at this point in the history
  • Loading branch information
mijanr committed Mar 16, 2024
1 parent f493a06 commit 3fa1583
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/update_readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,23 @@ 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)
# add the content of best_runs.md to README.md at line number 57
updated_readme_content=$(awk -v best_runs_content="${{ steps.read_best_runs.outputs.content }}" 'NR==57{print best_runs_content}1' 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
Expand Down

0 comments on commit 3fa1583

Please sign in to comment.