Monitor Schema Agent #149
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: Monitor Schema Agent | |
| on: | |
| schedule: | |
| - cron: '30 4 * * 0' # Run weekly at 4:30am UTC on Sundays (0) | |
| workflow_dispatch: # Allow manual triggering also | |
| push: | |
| branches: | |
| - main # Run on pushes to the main branch | |
| permissions: | |
| contents: write | |
| jobs: | |
| run-agent: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12.x' | |
| - name: Uninstall old civic-lib-core if exists | |
| run: pip uninstall -y civic-lib-core civic_interconnect_lib || true | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel --prefer-binary | |
| python -m pip install --upgrade .[dev] | |
| - name: Run agent | |
| env: | |
| OPENSTATES_API_KEY: ${{ secrets.OPENSTATES_API_KEY }} | |
| run: | | |
| schema-agent start | |
| - name: Commit daily report | |
| run: | | |
| git config user.name "civic-interconnect[bot]" | |
| git config user.email "bot@civic-interconnect.org" | |
| git add reports/ | |
| git commit -m "Daily report for $(date -u +'%Y-%m-%d')" || echo "No changes to commit" | |
| git push origin main | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |