Daily Maintenance #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Daily Maintenance | |
| on: | |
| schedule: | |
| - cron: '0 7 * * *' # 07:00 UTC every day | |
| workflow_dispatch: | |
| jobs: | |
| # ── 1. Dependency version check ─────────────────────────────────────────── | |
| check-deps: | |
| name: Check dependency versions | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Fetch latest versions | |
| id: versions | |
| run: | | |
| FILAMENT_LATEST=$(curl -s https://api.github.com/repos/google/filament/releases/latest | jq -r .tag_name | tr -d 'v') | |
| ARCORE_LATEST=$(curl -s https://api.github.com/repos/google-ar/arcore-android-sdk/releases/latest | jq -r .tag_name | tr -d 'v') | |
| KOTLIN_LATEST=$(curl -s https://api.github.com/repos/JetBrains/kotlin/releases/latest | jq -r .tag_name | tr -d 'v') | |
| FILAMENT_CURRENT=$(grep "filament_version" buildSrc/src/main/groovy/FilamentPlugin.groovy 2>/dev/null | head -1 | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' || echo "unknown") | |
| KOTLIN_CURRENT=$(grep "kotlin" gradle/libs.versions.toml 2>/dev/null | head -1 | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' || echo "unknown") | |
| ARCORE_CURRENT=$(grep "arcore" gradle/libs.versions.toml 2>/dev/null | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -1 || echo "unknown") | |
| echo "filament_latest=$FILAMENT_LATEST" >> $GITHUB_OUTPUT | |
| echo "filament_current=$FILAMENT_CURRENT" >> $GITHUB_OUTPUT | |
| echo "arcore_latest=$ARCORE_LATEST" >> $GITHUB_OUTPUT | |
| echo "arcore_current=$ARCORE_CURRENT" >> $GITHUB_OUTPUT | |
| echo "kotlin_latest=$KOTLIN_LATEST" >> $GITHUB_OUTPUT | |
| echo "kotlin_current=$KOTLIN_CURRENT" >> $GITHUB_OUTPUT | |
| - name: Report outdated dependencies | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| BODY="## Dependency status — $(date +%Y-%m-%d)\n\n" | |
| BODY+="| Dependency | Current | Latest |\n|---|---|---|\n" | |
| BODY+="| Filament | ${{ steps.versions.outputs.filament_current }} | ${{ steps.versions.outputs.filament_latest }} |\n" | |
| BODY+="| ARCore | ${{ steps.versions.outputs.arcore_current }} | ${{ steps.versions.outputs.arcore_latest }} |\n" | |
| BODY+="| Kotlin | ${{ steps.versions.outputs.kotlin_current }} | ${{ steps.versions.outputs.kotlin_latest }} |\n" | |
| # Post as a comment on the pinned maintenance issue if it exists, otherwise just log | |
| echo -e "$BODY" | |
| # ── 2. Stale issue detection ─────────────────────────────────────────────── | |
| stale: | |
| name: Mark stale issues | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/stale@v9 | |
| with: | |
| stale-issue-message: > | |
| This issue has been open for 30 days with no activity. | |
| If it is still relevant, please leave a comment — otherwise it will be closed in 7 days. | |
| close-issue-message: > | |
| Closing due to inactivity. Feel free to reopen if the issue is still relevant. | |
| stale-pr-message: > | |
| This PR has been open for 30 days with no activity. | |
| Please rebase and update — it will be closed in 7 days if there is no response. | |
| days-before-stale: 30 | |
| days-before-close: 7 | |
| exempt-issue-labels: 'pinned,roadmap,in-progress' | |
| exempt-pr-labels: 'pinned' | |
| # ── 3. CI health summary ────────────────────────────────────────────────── | |
| ci-health: | |
| name: CI health check | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check recent CI runs | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| FAILURES=$(gh run list --workflow=ci.yml --limit 7 --json conclusion,createdAt,name \ | |
| | jq '[.[] | select(.conclusion == "failure")] | length') | |
| echo "CI failures in last 7 runs: $FAILURES" | |
| if [ "$FAILURES" -gt 2 ]; then | |
| echo "⚠️ CI is consistently failing — investigate" | |
| gh issue list --label "ci-failure" --state open | grep -q "." || \ | |
| gh issue create \ | |
| --title "CI health: $FAILURES failures in last 7 runs — $(date +%Y-%m-%d)" \ | |
| --label "bug" \ | |
| --body "Automated maintenance detected $FAILURES CI failures in the last 7 runs. Please investigate." | |
| fi |