chore(cd): don't run nightly release if their is no new commits
This commit is contained in:
		
							parent
							
								
									d2a2686705
								
							
						
					
					
						commit
						ebfdb64fde
					
				
							
								
								
									
										18
									
								
								.github/workflows/docker-nightly-release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.github/workflows/docker-nightly-release.yml
									
									
									
									
										vendored
									
									
								
							| @ -6,8 +6,26 @@ on: | |||||||
|     - cron: '0 0 * * *' |     - 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 | ||||||
|  |         if: ${{ github.event_name == 'schedule' }} | ||||||
|  |         run: test -z $(git rev-list  --after="24 hours"  ${{ github.sha }}) && echo "::set-output name=should_run::false" | ||||||
|  | 
 | ||||||
|   ci: |   ci: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|  |     needs: check_date | ||||||
|  |     if: ${{ needs.check_date.outputs.should_run != 'false' }} | ||||||
| 
 | 
 | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@v3 |       - uses: actions/checkout@v3 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user