Skip to content

Commit

Permalink
update workflow using git_secrets variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mijanr committed Apr 7, 2024
1 parent d775ecc commit dc81381
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/update_readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ jobs:
- name: Run script
run: python results/gen_result.py

- name: Set Git Config
run: |
git config --global user.email "${{ secrets.MY_EMAIL }}"
git config --global user.name "${{ secrets.MY_NAME }}"
- name: Commit results if it changed
run: |
# if the results changed then commit the changes
if [[ $(git status --porcelain) ]]; then
git config --global user.email "[email protected]"
git config --global user.name "Md Mijanur Rahman"
git add results/best_runs.md
git commit -am "Update results" || exit 0
git push
fi
Expand All @@ -45,8 +49,10 @@ jobs:
- name: Commit and push if it changed
run: |
git diff
git config --global user.email "[email protected]"
git config --global user.name "Md Mijanur Rahman"
git commit -am "Update README with test results" || exit 0
git push
if [[ $(git status --porcelain) ]]; then
git add README.md
git commit -am "Update README with test results" || exit 0
git push
fi

0 comments on commit dc81381

Please sign in to comment.