Update updateDB

This commit is contained in:
Andros Fenollosa 2021-04-18 21:34:23 +02:00
parent 3e1c736ded
commit f50bc7c848
2 changed files with 18 additions and 5 deletions

View File

@ -29,8 +29,4 @@ jobs:
- name: Update database - name: Update database
run: | run: |
cd recurring-execution-with-actions cd recurring-execution-with-actions
git config user.email "action@github.com" ./updateDB.sh
git config user.name "GitHub Action"
git add isahn_history.json
git commit -m 'Update history'
git push -f origin master

View File

@ -0,0 +1,17 @@
#!/bin/bash
cd recurring-execution-with-actions
git add isahn_history.json
set +e # Grep succeeds with nonzero exit codes to show results.
git status | grep modified
if [ $? -eq 0 ]
then
set -e
git config user.email "action@github.com"
git config user.name "GitHub Action"
git commit -am "updated on - $(date)"
git push origin master
else
set -e
echo "No changes since last run"
fi