|
| 1 | +name: ONIX Weekly Briefing |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # Every Friday at 17:00 UTC |
| 6 | + - cron: '0 17 * * 5' |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + week_override: |
| 10 | + description: 'Manual run - override week label' |
| 11 | + required: false |
| 12 | + default: '' |
| 13 | + |
| 14 | +jobs: |
| 15 | + generate-briefing: |
| 16 | + name: Generate ONIX Weekly Brief |
| 17 | + runs-on: ubuntu-latest |
| 18 | + permissions: |
| 19 | + contents: read |
| 20 | + issues: write |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout repository |
| 24 | + uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + fetch-depth: 0 |
| 27 | + |
| 28 | + - name: Get week number |
| 29 | + id: week |
| 30 | + run: | |
| 31 | + WEEK=$(date +%V) |
| 32 | + YEAR=$(date +%Y) |
| 33 | + echo "label=W${WEEK}-${YEAR}" >> $GITHUB_OUTPUT |
| 34 | + echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT |
| 35 | +
|
| 36 | + - name: Collect git activity (last 7 days) |
| 37 | + id: git_activity |
| 38 | + run: | |
| 39 | + COMMITS=$(git log --oneline --since='7 days ago' --format='- %s (%an)' | head -20) |
| 40 | + COMMIT_COUNT=$(git log --oneline --since='7 days ago' | wc -l | tr -d ' ') |
| 41 | + echo "commit_count=${COMMIT_COUNT}" >> $GITHUB_OUTPUT |
| 42 | + # Store multiline output |
| 43 | + echo 'commits<<EOF' >> $GITHUB_OUTPUT |
| 44 | + echo "${COMMITS}" >> $GITHUB_OUTPUT |
| 45 | + echo 'EOF' >> $GITHUB_OUTPUT |
| 46 | +
|
| 47 | + - name: Collect open issues count |
| 48 | + id: issues |
| 49 | + env: |
| 50 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 51 | + run: | |
| 52 | + OPEN_ISSUES=$(gh issue list --state open --json number | jq length) |
| 53 | + OPEN_PRS=$(gh pr list --state open --json number | jq length) |
| 54 | + echo "open_issues=${OPEN_ISSUES}" >> $GITHUB_OUTPUT |
| 55 | + echo "open_prs=${OPEN_PRS}" >> $GITHUB_OUTPUT |
| 56 | +
|
| 57 | + - name: Check Vercel deployment status |
| 58 | + id: vercel |
| 59 | + run: | |
| 60 | + # Check if onoxsystems.com is reachable |
| 61 | + HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" https://onoxsystems.com || echo "000") |
| 62 | + if [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "301" ] || [ "$HTTP_CODE" = "302" ]; then |
| 63 | + echo "status=ONLINE (HTTP ${HTTP_CODE})" >> $GITHUB_OUTPUT |
| 64 | + else |
| 65 | + echo "status=CHECK NEEDED (HTTP ${HTTP_CODE})" >> $GITHUB_OUTPUT |
| 66 | + fi |
| 67 | +
|
| 68 | + - name: Create ONIX Weekly Brief issue |
| 69 | + env: |
| 70 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + run: | |
| 72 | + WEEK_LABEL="${{ steps.week.outputs.label }}" |
| 73 | + DATE="${{ steps.week.outputs.date }}" |
| 74 | + COMMITS="${{ steps.git_activity.outputs.commits }}" |
| 75 | + COMMIT_COUNT="${{ steps.git_activity.outputs.commit_count }}" |
| 76 | + OPEN_ISSUES="${{ steps.issues.outputs.open_issues }}" |
| 77 | + OPEN_PRS="${{ steps.issues.outputs.open_prs }}" |
| 78 | + VERCEL_STATUS="${{ steps.vercel.outputs.status }}" |
| 79 | +
|
| 80 | + BODY="# ONIX Weekly Brief \u2014 ${WEEK_LABEL} |
| 81 | +
|
| 82 | +**Generated:** ${DATE} |
| 83 | +**Maintained by:** ONIX Agent |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +## Estado del Sistema |
| 88 | + |
| 89 | +| Service | Status | |
| 90 | +|---------|--------| |
| 91 | +| onoxsystems.com | ${VERCEL_STATUS} | |
| 92 | +| Supabase | Check dashboard | |
| 93 | +| Tailscale | Check nodes | |
| 94 | + |
| 95 | +--- |
| 96 | + |
| 97 | +## Actividad de la Semana |
| 98 | + |
| 99 | +- **Commits:** ${COMMIT_COUNT} en los ultimos 7 dias |
| 100 | + |
| 101 | +### Commits Recientes |
| 102 | +${COMMITS} |
| 103 | + |
| 104 | +--- |
| 105 | + |
| 106 | +## Estado del Repositorio |
| 107 | + |
| 108 | +- **Issues abiertos:** ${OPEN_ISSUES} |
| 109 | +- **PRs abiertos:** ${OPEN_PRS} |
| 110 | + |
| 111 | +--- |
| 112 | + |
| 113 | +## Propuestas para el Equipo |
| 114 | + |
| 115 | +> ONIX: Revisar issues abiertos. Priorizar segun ROADMAP.md. |
| 116 | + |
| 117 | +1. Revisar PRs pendientes antes del lunes |
| 118 | +2. Actualizar STUDIES.md con hallazgos de la semana |
| 119 | +3. Verificar metricas de onoxsystems.com |
| 120 | + |
| 121 | +--- |
| 122 | + |
| 123 | +## Agenda para Mario |
| 124 | + |
| 125 | +- [ ] Revisar este briefing |
| 126 | +- [ ] Aprobar/rechazar propuestas del equipo |
| 127 | +- [ ] Confirmar prioridades para la semana siguiente |
| 128 | + |
| 129 | +--- |
| 130 | + |
| 131 | +## Proximos Hitos (ver ROADMAP.md) |
| 132 | + |
| 133 | +Revisar [ROADMAP.md](../blob/main/ROADMAP.md) para el estado de los hitos actuales. |
| 134 | + |
| 135 | +--- |
| 136 | + |
| 137 | +*Generado automaticamente por ONIX. Mario tiene la decision final.*" |
| 138 | + |
| 139 | + gh issue create \ |
| 140 | + --title "[ONIX Brief] ${WEEK_LABEL} \u2014 $(date +%Y-%m-%d)" \ |
| 141 | + --body "${BODY}" \ |
| 142 | + --label "onix-brief" \ |
| 143 | + || echo "Note: 'onix-brief' label may not exist yet. Create it in GitHub Issues settings." |
| 144 | + |
| 145 | + notify-team: |
| 146 | + name: Post notification |
| 147 | + runs-on: ubuntu-latest |
| 148 | + needs: generate-briefing |
| 149 | + steps: |
| 150 | + - name: Summary |
| 151 | + run: | |
| 152 | + echo "ONIX Weekly Brief generated successfully." |
| 153 | + echo "Check the Issues tab for the new brief labeled 'onix-brief'." |
| 154 | + echo "Mario: please review and approve agenda items." |
0 commit comments