diff --git a/.github/workflows/update_readme.yaml b/.github/workflows/update_readme.yaml new file mode 100644 index 00000000..9ba2018e --- /dev/null +++ b/.github/workflows/update_readme.yaml @@ -0,0 +1,29 @@ +name: Update README + +on: + push: + branches: + - main + +jobs: + update-readme: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Replace results in README + run: | + results=$(cat results/best_runs.md) # Read the results + + # Replace the results in the README + awk -v r="$results" '// {print; print r; f=1} // {f=0} !f' README.md > temp && mv temp README.md + + - name: Commit and push if it changed + run: | + git diff + git config --global user.email "md.rahman.ce@gmail.com" + git config --global user.name "Md Mijanur Rahman" + git commit -am "Update README with test results" || exit 0 + git push \ No newline at end of file