Run update.sh on PR and on cron.

Signed-off-by: pierreozoux <pierre@ozoux.net>
This commit is contained in:
pierreozoux 2020-08-25 17:33:10 +02:00 committed by Pierre Ozoux
parent 83b38c57a6
commit 1eb77283c1
1 changed files with 21 additions and 15 deletions

View File

@ -1,22 +1,28 @@
name: update.sh
on:
pull_request:
defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'
push:
branches:
- master
schedule:
- cron: '15 0 * * *'
jobs:
check-changes:
name: Check for Changes
run_update_sh:
name: Run update.sh script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check for Changes
run: |
hash_before="$(git write-tree)"
./update.sh
git add -A
[[ "$hash_before" = "$(git write-tree)" ]]
- uses: actions/checkout@v2
- name: Run update.sh script
run: ./update.sh
- name: Commit files
run: |
git config --local user.email "workflow@github.com"
git config --local user.name "GitHub Workflow"
git add ./*
git commit -m "Runs update.sh"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true