How go-555/github-actions-note works
Project Type and Purpose
• This is a CI/CD pipeline repository that implements a “Note Workflow” on GitHub Actions. Its goal is to automate researching, drafting, fact-checking, and posting blog posts to note.com using various AI and browser-automation services.
File Structure Analysis
• .github/workflows/note.yaml defines the main workflow with four sequential jobs: Research, Write, Fact-check, Post.
• login-note.mjs is a standalone Playwright script to obtain and persist note.com login cookies (storageState) as JSON. The resulting file’s contents are stored in the NOTE_STORAGE_STATE_JSON secret.
• package.json + package-lock.json define dependencies: Playwright, Claude Code SDK, Anthropic SDK, Tavily API, and marked.
• .env.sample hints at environment variable usage but secrets live in GitHub repo settings.
• There are no “frontend” or “backend” directories; this is purely an automation/tool pipeline.
Key Components
a. GitHub Actions Runner
• Hosts the workflow defined in .github/workflows/note.yaml.
• Trigger: Manual dispatch with inputs (theme, target, etc.).
b. Workflow Jobs (in order)
1. Research Agent
• Uses Claude Code SDK → WebSearch & WebFetch.
2. Writing Agent
• Uses Anthropic Claude Sonnet for title/body/tags.
3. Fact-check Agent
• Uses Tavily API to verify facts and adjust content.
4. Post Agent
• Uses Playwright (+ marked) to load note.com, set storageState (from NOTE_STORAGE_STATE_JSON), and draft/publish.
c. External Services
• Claude Code SDK endpoints for web research.
• Anthropic Claude API for text generation.
• Tavily API for fact verification.
• .com website (via Playwright).
d. Secrets & Storage
• ANTHROPIC_API_KEY, TAVILY_API_KEY, NOTE_STORAGE_STATE_JSON.
• login-note.mjs generates note-state.json locally (excluded from git), whose contents become NOTE_STORAGE_STATE_JSON.
Relationships & Data Flow
• Manual trigger on GitHub → Runner spins up → workflow inputs propagate to each job.
• Each job consumes the output of the previous (implicitly via job ordering and shared workspace or via parameters).
• The final job reads NOTE_STORAGE_STATE_JSON (unpacked to a temp file) to log into note.com and post.
Architectural Patterns / Principles
• Pipeline/Orchestration pattern: clearly staged sequential jobs.
• Separation of concerns: each job has a single responsibility.
• Secret management: sensitive tokens and storage state kept in GitHub Secrets.
• Extensibility: Adding a new agent is as simple as adding another job.