nightly push action rework v4

probably safer to move the dependent job into the
same action file. of course there's probably a way to
separate them but there's also no way to test for certain
This commit is contained in:
Eliot Jones
2021-08-14 13:20:08 -04:00
parent fcdd08a21c
commit 235f789e4f
2 changed files with 16 additions and 20 deletions

View File

@@ -1,19 +0,0 @@
# https://github.community/t/trigger-action-on-schedule-only-if-there-are-changes-to-the-branch/17887/2
name: check_date
on: repository_dispatch
jobs:
check_date:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v2
- name: print latest_commit
run: echo ${{ github.sha }}
- id: should_run
continue-on-error: true
name: check latest commit is less than a day ago
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"

View File

@@ -4,7 +4,22 @@ on:
schedule:
- cron: '0 0 * * *'
jobs:
jobs:
check_date:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v2
- name: print latest_commit
run: echo ${{ github.sha }}
- id: should_run
continue-on-error: true
name: check latest commit is less than a day ago
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
build_and_publish_nightly:
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}