From 1eb77283c1f005b5eac08c293774d2055a77cc65 Mon Sep 17 00:00:00 2001 From: pierreozoux Date: Tue, 25 Aug 2020 17:33:10 +0200 Subject: [PATCH] Run update.sh on PR and on cron. Signed-off-by: pierreozoux --- .github/workflows/update-sh.yml | 36 +++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/update-sh.yml b/.github/workflows/update-sh.yml index 3f5fb09d..24551a23 100644 --- a/.github/workflows/update-sh.yml +++ b/.github/workflows/update-sh.yml @@ -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