Weekly
Draft your weekly timesheet from email and commits
Every Friday you get an email with a draft timesheet, grouped by client and task, built from the emails you sent and the code you committed that week.
- Runs
- Weekly
- Apps
- GitHub, Gmail
- AI
- Yes, uses the built-in AI allowance
- Access
- gmail.readonly, gmail.send; GitHub repo read
Send this to your assistant
Create a ClickRuntime automation: every Friday at 4, look at the emails I sent and my GitHub commits this week, group them into tasks per client with estimated hours, and email me the draft timesheet.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A freelance developer bills four clients by the hour. Every Friday they try to reconstruct the week from memory, scrolling through sent mail and commit history, and inevitably forget an afternoon of calls or a quick fix. Unbilled hours add up to real money over a year.
A drafted timesheet built from what they actually sent and committed gives them a starting point that misses very little. They adjust the hours, and invoices go out on time with fewer gaps.
What you get out of it
Fewer forgotten hours
Every commit and sent email is a reminder of work done. Small tasks that would be forgotten end up on the timesheet.
Grouped by client
Work is sorted by client and task, matching how you invoice. Copying it into an invoice is quick.
A draft, not a final answer
Hours are estimates you correct. You stay in charge of what gets billed.
Friday admin takes minutes
Instead of reconstructing the week, you review a list. The end of the week goes back to actual work or rest.
How it works
What happens, step by step
Every Friday afternoon, ClickRuntime collects the emails you sent this week from Gmail.
It also collects the commits you made in GitHub this week.
AI groups everything into tasks per client and estimates the hours for each.
The draft timesheet is emailed to you to check and adjust.
Before it runs live
- Connect GitHub
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
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 Gmail steps into one automation
Under the hood
The code that runs this automation
from datetime import date, timedelta
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, notify, 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 = "your-github-username"
@on_trigger
def run(event):
since = date.today() - timedelta(days=date.today().weekday())
gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users()
sent = gmail.messages().list(userId="me", q=f"in:sent after:{since:%Y/%m/%d}", maxResults=100).execute().get("messages", [])
mails = []
for m in sent:
h = {x["name"]: x["value"] for x in gmail.messages().get(userId="me", id=m["id"], format="metadata",
metadataHeaders=["To", "Subject", "Date"]).execute()["payload"]["headers"]}
mails.append(f"{h.get('Date', '')[:16]} to {h.get('To')}: {h.get('Subject')}")
commits = gh("GET", "/search/commits", params={"q": f"author:{AUTHOR} committer-date:>={since}", "per_page": 100})["items"]
work = [f"{c['commit']['author']['date'][:10]} {c['repository']['full_name']}: {c['commit']['message'].splitlines()[0]}" for c in commits]
draft = ai.generate("Sent emails:\n" + "\n".join(mails) + "\n\nCommits:\n" + "\n".join(work), max_output_tokens=1200,
system="Group this week's work into tasks per client with estimated hours. Output a plain-text table.").text
notify.email_me(f"Draft timesheet, week of {since:%d %b}", draft)
return {"emails": len(mails), "commits": len(work)}FAQ
Common questions
How does it know which client each item is for?
Does it read the content of my emails?
Can it fill a timesheet sheet directly?
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
Email a weekly changelog from merged pull requests
Every Friday you get a customer-friendly changelog written from the week's merged pull requests, with any risky changes flagged for a second look.
See how it worksMonitor your site and update a GitHub status page
If your site goes down you get an email within five minutes, and the status page you host on GitHub updates itself, then again when the site is back.
See how it worksLabel new GitHub issues and email me about bugs
New GitHub issues are labelled by type automatically, and you get an email whenever one is a bug.
See how it worksKeep exploring
Set up “Draft your weekly timesheet from email and commits” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.