A Weekly AI Blog Pipeline, With a Human in the Loop
Plenty of small businesses want a blog and never have time to write one. I built a pipeline that drafts a weekly post with AI, checks it, and hands it to a person before anything goes live.
Why bother
A salon, a groomer, or a small shop knows a blog would help, but nobody has time to write one every week. AI can draft the posts. The hard part is doing it carefully. A model that writes whatever it wants and publishes it straight to a website isn't impressive. It's a liability.
How it works
A GitHub Action runs every Monday morning. Each site gets its own config file with its own topics, so the same pipeline can write hair care tips for a salon or grooming tips for a groomer. The version I run for myself alternates between a security roundup built from public security news feeds and an engineering tip from my own topic list.
Every Monday (GitHub Actions)
↓
Pick the post type: security roundup or engineering tip
↓
Roundup: pull recent items from public security feeds
Tip: pick the next unused topic from my list
↓
Ask the model for a draft in a strict JSON shape
↓
Validate the draft (structure, length, links, wording)
↓
Open a pull request
↓
A person reviews it → merge → the site rebuildsThe guardrails
This is the part I care about most. The model's output is treated as untrusted input, the same way you'd treat anything a user types into a form.
- Links can only come from the feeds. Every URL in a draft is checked against the actual feed items. If the model invents a source, the run fails.
- Feed content is treated as data, not instructions. The prompt says so explicitly, because news headlines are written by strangers and could include text designed to manipulate a model.
- The output has to match a fixed structure. Titles, summaries, sections, and lengths are all checked before anything is saved.
- No pretending to be me. The model is told not to invent personal experiences, and drafts with first-person workplace claims are rejected.
- The API key never touches the code. It lives in GitHub's encrypted secrets.
- Nothing publishes automatically. Every post arrives as a pull request, and a person reads it before it goes live.
Why a pull request instead of auto-publishing
Validation catches broken structure and fake links. It can't catch a summary that's technically accurate but misses the point, or a tip that's correct but not very useful.
That's a judgment call, and it should be a person's. The pull request is where it happens. If a draft isn't good, close it and nothing happens.
Drafts also stay hidden on the live site until they're marked as reviewed. Merging too quickly can't accidentally publish a post nobody has read.
For business websites
When this runs on a business's site, I recommend labeling the posts as AI-assisted. Customers deserve to know what they're reading, and being upfront about it costs nothing.
The owner still gets the real benefit: a steady stream of useful posts, without the blank page every Monday.
What I took away from it
- The interesting engineering in an AI feature is usually everything around the model call.
- Treat model output like user input: validate it before you trust it.
- Give the model less freedom, not more. A tight structure and a short list of allowed sources make it far more reliable.
- Keep a human in the loop for anything that represents you.