chore(cd): don't run nightly release if their is no new commits

This commit is contained in:
Corentin Thomasset 2023-04-09 15:27:58 +02:00
parent d2a2686705
commit ebfdb64fde
No known key found for this signature in database
GPG key ID: DBD997E935996158

View file

@ -6,8 +6,26 @@ on:
- cron: '0 0 * * *'
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
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
ci:
runs-on: ubuntu-latest
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
steps:
- uses: actions/checkout@v3