On a schedule
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.
- Runs
- On a schedule
- Apps
- GitHub, Google Sheets
- AI
- Yes, uses the built-in AI allowance
- Access
- GitHub read (contents/metadata); sheet shared with service account as editor
Send this to your assistant
Create a ClickRuntime automation: every Friday, collect my commits and pull requests from this week, group them by repo and day, have AI describe the work with estimated hours, and add rows to my Timesheet sheet.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A contractor working for an agency has to log hours per project in a shared Google Sheet every week. They write code all week and then spend Friday afternoon trying to remember which day went to which client.
Rows drafted from their actual commits and pull requests, grouped by day and repository, turn that guesswork into a quick review. The agency gets accurate, timely timesheets, and the contractor gets their Friday back.
What you get out of it
Timesheets match the work
Each row is backed by real commits and pull requests. Questions about what a day was spent on are easy to answer.
Grouped the way you bill
Rows are per repository and day, which usually maps to a client or project. The sheet is ready for invoicing.
Readable descriptions
AI turns commit messages into plain sentences a project manager understands. No more rows that just say 'fixes'.
Hours are yours to adjust
Estimated hours are a starting point. Change them in the sheet before submitting.
How it works
What happens, step by step
Every Friday, ClickRuntime collects your commits and pull requests from GitHub for the week.
It groups them by day and repository.
AI writes a short description of each group and estimates the hours spent.
The rows are added to your Timesheet sheet in Google Sheets.
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
from collections import defaultdict
from datetime import date, timedelta
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)
AUTHOR, SHEET_ID = "your-github-username", "your-spreadsheet-id"
SCHEMA = {"type": "object", "properties": {"rows": {"type": "array", "items": {"type": "object", "properties": {
"day": {"type": "string"}, "repo": {"type": "string"}, "description": {"type": "string"}, "hours": {"type": "number"}}}}}}
@on_trigger
def run(event):
since = date.today() - timedelta(days=date.today().weekday())
groups = defaultdict(list)
for c in gh("GET", "/search/commits", params={"q": f"author:{AUTHOR} committer-date:>={since}", "per_page": 100})["items"]:
groups[(c["commit"]["author"]["date"][:10], c["repository"]["name"])].append(f"{c['commit']['author']['date'][11:16]} {c['commit']['message'].splitlines()[0]}")
for p in gh("GET", "/search/issues", params={"q": f"author:{AUTHOR} is:pr updated:>={since}", "per_page": 50})["items"]:
groups[(p["updated_at"][:10], p["repository_url"].split("/")[-1])].append(f"PR: {p['title']}")
if not groups:
return {"rows": 0}
text = "\n\n".join(f"{d} {r}:\n" + "\n".join(items) for (d, r), items in sorted(groups.items()))
rows = ai.generate(text[:20000], json_schema=SCHEMA, max_output_tokens=1500,
system="For each day and repo, write a one-sentence description of the work and estimate hours from commit times.").json["rows"]
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
sheets.spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Timesheet!A:D", valueInputOption="USER_ENTERED",
body={"values": [[r["day"], r["repo"], r["description"], r["hours"]] for r in rows]}).execute()
return {"rows": len(rows)}FAQ
Common questions
How are hours estimated?
Can it map repositories to client names?
Which sheet and tab does it use?
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
Log 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 worksPublish 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.
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 “Fill a timesheet sheet from your GitHub activity” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.