diff --git a/.github/workflows/monitor_release.yml b/.github/workflows/monitor_release.yml index f236b34c42e..ce9fbe47a4f 100644 --- a/.github/workflows/monitor_release.yml +++ b/.github/workflows/monitor_release.yml @@ -1,7 +1,7 @@ name: monitor-release on: schedule: - - cron: "30 16 * * *" + - cron: "0 4 * * *" workflow_dispatch: {} jobs: monitor-release: diff --git a/.github/workflows/monitor_sync.yml b/.github/workflows/monitor_sync.yml new file mode 100644 index 00000000000..7d245e14bd0 --- /dev/null +++ b/.github/workflows/monitor_sync.yml @@ -0,0 +1,26 @@ +name: monitor-sync +on: + schedule: + - cron: "0 22 * * *" + workflow_dispatch: {} +jobs: + monitor-sync: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + - run: | + git fetch --prune --unshallow --tags + latest_commit=$(git log -1 --format="%at" | xargs -I{} date -d @{} "+%Y.%m.%d") + cur=$(date +"%Y.%m.%d") + + if [ "$latest_commit" != "$cur" ]; then + >&2 echo "Warning: No repository sync for one or more days" + exit 101 + fi + exit 0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPOSITORY: ${{ github.repository }} + BRANCH_NAME: ${{ github.ref_name }}