Check Repository Health #13
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: Check Repository Health | |
| on: | |
| schedule: | |
| - cron: "0 5 * * 0" # Runs at 05:00am UTC every Sunday | |
| workflow_dispatch: | |
| permissions: {} # none | |
| jobs: | |
| check-repository-health: | |
| if: github.repository == 'termux/termux-packages' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 1 | |
| - id: generate-apt-packages-list | |
| name: Generate list of packages | |
| run: | | |
| OUTPUT_DIR="$(mktemp -d)" | |
| echo "OUTPUT_DIR=$OUTPUT_DIR" >> "$GITHUB_OUTPUT" | |
| ./scripts/generate-apt-packages-list.sh "$OUTPUT_DIR" | |
| - name: Check repository health | |
| run: | | |
| set -euo pipefail | |
| export NODE_OPTIONS="--network-family-autoselection-attempt-timeout=500" | |
| ./scripts/check-repository-health.js "${{ steps.generate-apt-packages-list.outputs.OUTPUT_DIR }}" | tee repository-health.txt | |
| - name: Create issue if health check fails | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.TERMUXBOT2_TOKEN }} | |
| if: failure() | |
| run: | | |
| ISSUE_TITLE="Repository Health Check Failed" | |
| ISSUE_BODY=$(cat repository-health.txt) | |
| gh issue create --title "$ISSUE_TITLE" --body "$ISSUE_BODY" --label "health-check" --assignee "thunder-coding" |