From 7d5639ee9e05144879c31ecf89d63071902d2056 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Tue, 19 Mar 2024 12:51:29 -0700 Subject: [PATCH 1/2] Run preview_ci once a day --- .github/workflows/preview_ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/preview_ci.yml b/.github/workflows/preview_ci.yml index 961d8bf9b9a..fdeeea0acf5 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' From 93a8d1f93f6b562476109aabf8585d3b5c50e422 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Tue, 19 Mar 2024 13:50:25 -0700 Subject: [PATCH 2/2] Adding a 24 hours check --- .github/workflows/preview_ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/preview_ci.yml b/.github/workflows/preview_ci.yml index fdeeea0acf5..3d0693b5204 100644 --- a/.github/workflows/preview_ci.yml +++ b/.github/workflows/preview_ci.yml @@ -13,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: