diff --git a/.github/workflows/preview_ci.yml b/.github/workflows/preview_ci.yml index 961d8bf9b9a..3d0693b5204 100644 --- a/.github/workflows/preview_ci.yml +++ b/.github/workflows/preview_ci.yml @@ -1,5 +1,8 @@ name: Preview - CI on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' push: paths-ignore: - '**/*.md' @@ -10,9 +13,27 @@ env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: true jobs: + check_date: + runs-on: ${{ matrix.os }} + 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" + test: runs-on: ${{ matrix.os }} name: Build, Test, Deploy + needs: check_date + if: ${{ needs.check_date.outputs.should_run != 'false' }} strategy: fail-fast: false matrix: