Add monitoring workflows (#7)

This commit is contained in:
René Helmke 2023-12-14 16:57:00 +01:00 committed by GitHub
parent 0fb201f994
commit f8a794a730
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 1 deletions

View File

@ -1,7 +1,7 @@
name: monitor-release name: monitor-release
on: on:
schedule: schedule:
- cron: "30 16 * * *" - cron: "0 4 * * *"
workflow_dispatch: {} workflow_dispatch: {}
jobs: jobs:
monitor-release: monitor-release:

26
.github/workflows/monitor_sync.yml vendored Normal file
View File

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