Skip to content

Commit

Permalink
ci: nightly release only if there are changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Colerar committed Feb 14, 2024
1 parent 74b6ff3 commit 564d72e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ jobs:
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: |
echo "${{ github.event.inputs.isMock }}";
if [[ -z "${{ github.event.inputs.isMock }}" ]]; then
echo "This is a scheduled nightly run."
test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
test -z "$(git rev-list --after="24 hours" ${{ github.sha }})" && echo "::set-output name=should_run::false"
elif [[ "${{ github.event.inputs.isMock }}" == "mock" ]]; then
echo "This is a mock run."
else
Expand All @@ -48,6 +49,7 @@ jobs:
build-release:
needs: [initialize-job]
if: ${{ needs.initialize-job.outputs.should_run != 'false' }}
uses: ./.github/workflows/build_releases.yml
with:
branch: "dev"
Expand Down

0 comments on commit 564d72e

Please sign in to comment.