mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-21 23:36:15 -04:00
chore(cd): don't run nightly release if their is no new commits
This commit is contained in:
parent
d2a2686705
commit
ebfdb64fde
1 changed files with 18 additions and 0 deletions
18
.github/workflows/docker-nightly-release.yml
vendored
18
.github/workflows/docker-nightly-release.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue