Iteration Planner #7
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: Iteration Planner | |
| on: | |
| schedule: | |
| # Every Monday at 12:00 PM IST (06:30 UTC) — week-parity check runs inside the job | |
| - cron: "30 6 * * 1" | |
| workflow_dispatch: | |
| jobs: | |
| plan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check iteration week (first Monday of iteration) | |
| id: parity | |
| run: | | |
| # Manual triggers always run; scheduled runs check iteration position. | |
| # Epoch is a known first-Monday-of-iteration; counting weeks from it | |
| # avoids ISO week-number resets at year boundaries (e.g. 2026 has 53 | |
| # ISO weeks, which would break naive parity checks). | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "run=true" >> $GITHUB_OUTPUT | |
| else | |
| EPOCH_TS=$(date -d "2026-05-04" +%s) | |
| TODAY_TS=$(date +%s) | |
| WEEKS=$(( (TODAY_TS - EPOCH_TS) / 86400 / 7 )) | |
| ITER_WEEK=$((WEEKS % 2)) | |
| if [ "$ITER_WEEK" -eq 0 ]; then | |
| echo "run=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "Second Monday of iteration — skipping." | |
| echo "run=false" >> $GITHUB_OUTPUT | |
| fi | |
| fi | |
| - name: Checkout | |
| if: steps.parity.outputs.run == 'true' | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| if: steps.parity.outputs.run == 'true' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| if: steps.parity.outputs.run == 'true' | |
| run: pip install -r requirements.txt | |
| - name: Run planner | |
| if: steps.parity.outputs.run == 'true' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PROJECTS_READ_TOKEN }} | |
| ORG: glific | |
| PROJECT_NUMBER: "8" | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
| run: python iteration_planner.py |