On a schedule
Publish blog posts from a topic sheet to your GitHub site
On your schedule, the next topic in your sheet becomes a blog post committed to your site's repository, and the row is marked done.
- Runs
- On a schedule
- Apps
- GitHub, Google Sheets
- AI
- Yes, uses the built-in AI allowance
- Access
- GitHub contents write; sheet editor
Send this to your assistant
Create a ClickRuntime automation: every Tuesday, take the next topic marked Ready in my Blog sheet, write a post in Markdown with front matter and tags, commit it to src/content/blog in acme/website, and mark the row Published.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A developer tools startup runs its website on a static site generator in GitHub. The team keeps a sheet of blog ideas, but turning an idea into a post means writing, formatting front matter, creating a branch and committing, so the sheet grows and the blog does not.
Writing and committing the next post from the sheet on a schedule keeps the blog moving. The team owns the topic list and edits the result, while the formatting and publishing steps happen on their own.
What you get out of it
The topic list becomes posts
Ideas in the sheet turn into posts on a steady schedule. The backlog shrinks instead of growing.
Correct format every time
Each post has the front matter, tags and file name your site expects. Builds do not break on a missing field.
Everyone can suggest topics
Anyone can add a row to the sheet with a topic and notes. No Git knowledge is needed to contribute an idea.
Review through your usual process
Posts can go to a branch with a pull request instead of straight to main. Edits happen in your normal review flow.
How it works
What happens, step by step
On your schedule, ClickRuntime reads your Blog sheet and takes the first row marked Ready.
AI writes the post in Markdown, with a title, description and tags at the top in the format your site expects.
The post is saved as a new file in your website's GitHub repository.
The row is marked Published with the file name, so the topic is not used again.
Before it runs live
- Connect GitHub
- Connect your Google Sheets account and pick the spreadsheets it may use
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Slack
- Combine it with other GitHub and Google Sheets steps into one automation
Under the hood
The code that runs this automation
import base64, re
from datetime import date
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai
def gh(method, path, **kw):
resp = http.request(method, f"https://api.github.com{path}", headers={
"Authorization": f"Bearer {credentials.connection('github', 'work')}", "Accept": "application/vnd.github+json"}, **kw)
return resp.raise_for_status() or (resp.json() if resp.content else None)
REPO, FOLDER, SHEET_ID = "acme/website", "src/content/blog", "your-spreadsheet-id"
@on_trigger
def run(event):
values = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets().values()
rows = values.get(spreadsheetId=SHEET_ID, range="Blog!A2:C").execute().get("values", [])
nxt = next(((i, r) for i, r in enumerate(rows, start=2) if len(r) > 1 and r[1] == "Ready"), None)
if not nxt:
return {"published": None}
i, (topic, _, *notes) = nxt
md = ai.generate(f"Topic: {topic}\nNotes: {notes[0] if notes else ''}", max_output_tokens=2000,
system="Write a 700-word blog post in Markdown. Start with YAML front matter: title, description, pubDate, tags.").text
slug = re.sub(r"[^a-z0-9]+", "-", topic.lower()).strip("-")[:60]
path = f"{FOLDER}/{date.today()}-{slug}.md"
gh("PUT", f"/repos/{REPO}/contents/{path}", json={"message": f"Add post: {topic}", "content": base64.b64encode(md.encode()).decode()})
values.update(spreadsheetId=SHEET_ID, range=f"Blog!B{i}", valueInputOption="RAW", body={"values": [[f"Published {path}"]]}).execute()
return {"published": path}FAQ
Common questions
Which site generators does it work with?
Can I review posts before they go live?
What should a row contain?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Fill a timesheet sheet from your GitHub activity
Every Friday your timesheet sheet gets rows for the week's work, grouped by repository and day, with a short description and estimated hours.
See how it worksLog daily engineering activity to a sheet
Each morning yesterday's merged pull requests and closed issues are added to a sheet, and a short summary is sent to you.
See how it worksTriage new GitHub issues and pull requests into a sheet
Every new issue and pull request is labelled by type and priority, logged in a triage sheet, and critical ones are posted to Slack.
See how it worksKeep exploring
Set up “Publish blog posts from a topic sheet to your GitHub site” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.