Skip to content

monitor-sync

monitor-sync #3

Workflow file for this run

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 }}