Keep monthly coupon distribution alive #26
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: Keep monthly coupon distribution alive | |
on: | |
schedule: | |
- cron: "42 0 1 * *" | |
jobs: | |
keep_alive: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Add or update .keepalive | |
run: echo $(date +'%s') > .keepalive | |
- name: Commit .keepalive | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "JuiceShopBot" | |
if [ -n "$(git status --porcelain)" ]; then | |
git add . | |
git commit -m "Bump keep-alive on $(date +'%B %d, %Y %T (%Z)')" | |
git push origin $(git branch --show-current) | |
else | |
echo "Oops, seems the keep-alive failed!" | |
exit 1 | |
fi |