Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/weekly-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- cron: "0 9 * * 1" # Segunda 9h
workflow_dispatch:

permissions:
contents: write

jobs:
report:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -34,10 +37,14 @@ jobs:
run: npx tsx scripts/weekly-report.ts

# 4️⃣ Commitar relatório se gerado
- name: 💾 Commit Report
- name: 💾 Commit Report (safe)
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add reports/
git diff --cached --quiet || git commit -m "docs: relatório semanal automático"
git push
if [ -d "reports" ]; then
git add reports/
git diff --cached --quiet || git commit -m "docs: relatório semanal automático"
git push
else
echo "⚠️ Nenhum relatório gerado (pasta reports/ inexistente)"
fi
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ turbo
Thumbs.db

# Reports / Logs
reports/
logs/
*.log
*.out
Expand Down
15 changes: 15 additions & 0 deletions reports/weekly-2025-11-12.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
📊 **Relatório Semanal - Vibe Intel**
🗓️ Data: 12/11/2025

🚀 **Em Desenvolvimento (1)**
• Sprint 1: Infraestrutura de Testes [Fase 1 - Qualidade]

🧪 **Em Teste (0)**
(nenhuma)

✅ **Concluídas (0)**
(nenhuma)

---
📈 Total de Sprints Ativas: 1
📊 Progresso Geral: 0%
88 changes: 86 additions & 2 deletions scripts/sync-notion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ async function updateSprintStatus(sprintNumber: number, status: string) {
async function getSprintCommits(branch: string): Promise<string[]> {
try {
// garante que a main esteja disponível no ambiente CI
await git.fetch(["origin", "main", "--depth=5"]).catch(() => {});
await git.fetch(["origin", "main", "--depth=5"]).catch(() => { });

const log = await git.log({ from: "origin/main", to: branch }).catch(() => ({ all: [] }));
const commits = log.all.map((c: { message: string }) => c.message).filter(Boolean);

Expand Down Expand Up @@ -177,6 +177,89 @@ async function updateSprintDuration(sprintNumber: number, branch: string) {
}
}

/* ---------------------------------------------------------
* 💬 Criar rascunho de post no Notion → LinkedIn (Vibe Intel Style)
* --------------------------------------------------------- */

async function createLinkedInPost(sprintNumber: number) {
const pageId = SPRINT_PAGES[sprintNumber];
if (!pageId || !LINKEDIN_DB_ID) return;

try {
const sprint = await notion.pages.retrieve({ page_id: pageId });

const sprintName =
(sprint as any).properties?.Sprint?.title?.[0]?.plain_text ||
`Sprint ${sprintNumber}`;
const objetivo =
(sprint as any).properties?.["Objetivo Principal"]?.rich_text?.[0]
?.plain_text || "";

const commits = await getSprintCommits(`sprint/${sprintNumber}-*`);
const highlights = commits.slice(0, 3).join("\n");

const content = `🚀 **Sprint ${sprintNumber} concluída com sucesso!**

🧭 *Objetivo Principal:* ${objetivo || "—"}

📦 *Principais entregas:*
${highlights || "Nenhum commit registrado."}

💡 *Insights:* Cada sprint é um passo para deixar o Vibe Intel ainda mais inteligente, automatizado e escalável.

#VibeIntel #BuildInPublic #TypeScript #AI #DevTools #Automation #SoftwareEngineering`;

await notion.pages.create({
parent: { database_id: LINKEDIN_DB_ID },
properties: {
Post: {
title: [
{
text: {
content: `✅ Sprint ${sprintNumber}: ${sprintName}`,
},
},
],
},
Tipo: {
select: { name: "Milestone" },
},
Status: {
status: { name: "Rascunho" },
},
"Data Publicação": {
date: { start: new Date().toISOString().split("T")[0] },
},
"Sprint Relacionada": {
relation: [{ id: pageId }],
},
Hashtags: {
multi_select: [
{ name: "VibeIntel" },
{ name: "BuildInPublic" },
{ name: "AI" },
{ name: "Automation" },
{ name: "SoftwareEngineering" },
],
},
},
children: [
{
object: "block",
type: "paragraph",
paragraph: {
rich_text: [{ type: "text", text: { content } }],
},
},
],
});

console.log(`📱 Post LinkedIn (Vibe Intel) criado como RASCUNHO para Sprint ${sprintNumber}`);
} catch (err) {
console.error("❌ Erro ao criar post LinkedIn:", (err as Error).message);
}
}

/* ---------------------------------------------------------
* 🚀 Execução principal
* --------------------------------------------------------- */
Expand All @@ -200,6 +283,7 @@ if (!sprintNumber) {
if (prMerged) {
await updateSprintStatus(sprintNumber, "Concluído");
await updateSprintDuration(sprintNumber, branch);
await createLinkedInPost(sprintNumber);
} else {
await updateSprintStatus(sprintNumber, "Testando");
}
Expand Down