Merge pull request #258 from tonyspumoni/fix-score-updater

update score-updater step to push to PR branch, not default branch
This commit is contained in:
David Benepe
2022-10-22 13:34:08 -05:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -71,4 +71,5 @@ jobs:
with:
file-path: README.md
commit-msg: Update score in README
branch: ${{ env.GITHUB_REF_NAME }}
github-token: ${{ secrets.GITHUB_TOKEN }}
+2 -2
View File
@@ -1,6 +1,6 @@
if [[ $1 == '--update-readme' ]]; then
export NEW_SCORE=$(python3 ./tools/python/score.py)
echo $NEW_SCORE
echo "$NEW_SCORE"
python3 - <<'EOF' > README.md.tmp
import sys
import os
@@ -18,7 +18,7 @@ print(
)
)
EOF
mv README.md.tmp README.md
sed '$ { /^$/ d}' README.md.tmp > README.md # removes extra newlines at end of file
else
python3 ./tools/python/score.py "$@"
fi