-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (34 loc) · 1.21 KB
/
update_readme.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
best_run_content=$(cat results/best_runs.md)
echo "$best_run_content"
- name: Update README.md
run: |
# Read the content of README.md
readme_content=$(cat README.md)
#add the best runs content to the README.md at the end of the file
echo "$best_run_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