Update project progress #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update project progress | |
on: | |
workflow_dispatch: | |
jobs: | |
update-number: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Update with days elapsed since start of competition (March 1st, 2024) | |
run: | | |
days_elapsed=$(( ( $(date +%s) - $(date -d '2024-03-01' +%s) ) / 86400 + 1 )) | |
perl -i -pe "s/<span>\d+<\/span>%/<span>${days_elapsed}<\/span>%/" README.md | |
- name: Commit and push if changed | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Mateusz Migas" | |
git diff | |
git commit -am "Update project progress" || echo "No changes to commit" | |
git push | |