Never Miss an AI Project Again! GitHub Bot Sends Updates Straight to Your Inbox
Build a Zero-Server GitHub Bot to Track AI
& Open-Source Projects
Artificial Intelligence is moving at an
unbelievable speed. Every day, researchers and open-source developers release
brand new models, web interfaces, dataset loaders, and deep learning tools on
GitHub. Keeping track of all these releases can feel like a full-time job. If
you want to stay on top of the latest technology, you need a way to automate
this process. But traditionally, running an automation bot meant setting up a
virtual server, paying a hosting provider, configuring databases, and maintaining
the infrastructure. For a personal project, that is often too much work and too
expensive.
What if you could build a bot that runs
entirely for free, does not require a server, and uses a default configuration
that takes less than ten minutes to set up? In this guide, we will build
exactly that: a serverless GitHub bot. Every 30 minutes, this bot will search
the GitHub API for new repositories related to AI and Open Source. It
will compile the results, format them into a clean layout, and email them
directly to you. We achieve this by running a Python script on GitHub Actions
and leveraging GitHub's built-in email notification system.
Code URL: https://github.com/ramsharma12345/automate_blogPost
The Architecture: Serverless and
Secret-Free
Before we look at the code, let's talk
about how this bot sends emails without an email server. Usually, to send an
email from a script, you have to sign up for an SMTP provider (like SendGrid or
Mailgun) or use your personal Gmail account. This requires generating API keys,
storing them securely in your repository, and managing sender quotas. If your
keys leak, spammers could abuse your account.
To avoid this headache, our architecture
uses a clever trick: GitHub Issues.
In any GitHub repository, when a new issue is created, GitHub automatically
sends an email notification to the repository owner and anyone watching the
project. Instead of emailing you directly, our bot simply creates a new issue
in your private repository containing the list of new AI projects. GitHub's own
notification system does the work of formatting and delivering the email
straight to your inbox. This means you do not need to configure any SMTP
secrets, and the setup is completely default and secure.
Step 1: The Python Automation
Script (main.py)
The heart of our project is a lightweight
Python script. It handles two simple tasks: fetching the data from the GitHub
API and posting that data back as an issue. We use the standard Python library
along with the requests library to
handle HTTP requests.
To make sure we only get the absolute
newest projects, the script dynamically calculates the timestamp for 30 minutes
ago. It then requests a list of repositories created after that timestamp that
match the keywords 'ai' and 'open-source'. The URL query looks like this:
https://api.github.com/search/repositories?q=ai+open-source+created:>YYYY-MM-DDTHH:MM:SSZ
Once the data arrives, the script loops
through the list of repositories. It reads the name, description, star count,
and primary language, formatting everything into clean Markdown text. Finally,
it makes a POST request to the repository's issues endpoint using the
GITHUB_TOKEN provided by GitHub Actions to create the new issue.
Step 2: Scheduling with GitHub
Actions
To run this script automatically every 30
minutes, we write a YAML configuration file inside the .github/workflows/ directory. GitHub Actions is a built-in
automation platform that lets you run workflows triggered by events or
schedules. By defining a cron schedule, we instruct GitHub's cloud servers to
spin up a virtual machine, download our code, install Python, and execute our
script.
The schedule uses standard cron syntax: */30 * * * * (which translates to
'every 30 minutes'). We also include a workflow_dispatch
trigger, which gives us a button in the GitHub UI to run the script manually
whenever we want to test it. We also declare the required permissions so that
our workflow is allowed to write issues to the repository.
When
you first push this folder structure to a brand new repository, GitHub Actions
won't show any history. It will display a default setup screen until the
workflow file is successfully detected on the default branch:
Step 3: Granting Permissions and
Testing
By default, GitHub Actions scripts run in a
highly secure environment where they can only read the repository, not modify
it. If you try to run the workflow immediately, it will fail when trying to
create the issue because of a 'Permission Denied' error. To fix this, you need
to adjust one setting in your repository:
·
1. Navigate to your repository
page on GitHub.
·
2. Click on the Settings tab at
the top of the page.
·
3. In the left sidebar, click
Actions, and then select General.
·
4. Scroll all the way down to
the Workflow permissions section.
·
5. Change the option from 'Read
repository content and packages permissions' to 'Read and write permissions'.
·
6. Click Save.
With the correct permissions, you can head
back to the Actions tab, select your
workflow, and click Run workflow.
GitHub will spin up a runner and execute the task.
Once
the run finishes successfully, a green checkmark will appear next to the job,
showing that our Python script executed successfully:
Step 4: Inspecting the Results
Now, navigate to the Issues tab in your repository. You will see a newly opened issue.
The title will display the current date and time of the search, and the body
will list the repositories that were created or updated in the last 30 minutes.
Here
is an example of what the generated issue looks like, including the repository
link, description, stars, and language format:
Because you are the owner of this
repository, GitHub will immediately forward this issue as an email directly to
your account. This means you do not need to keep checking GitHub—your email
inbox will become your personal dashboard for the latest AI projects!
How to Customize Your Bot
The beauty of this project is its
flexibility. Because it is a simple Python script, you can easily modify it to
fit your needs. Here are a few ideas on how to customize your search
parameters:
·
Change the Keywords: If you are
interested in Web Development or Cybersecurity instead of AI, simply open
main.py and change the query string from 'ai open-source' to 'react tailwind'
or 'security python'.
·
Filter by Stars: If you only want to see
high-quality repositories that are already gaining traction, add the stars
filter to the search query, like 'ai open-source stars:>50'.
· Change the Interval: If receiving an email every 30 minutes is too frequent, open schedule.yml and change the cron schedule. For example, '0 0 * * *' will run the bot once a day at midnight, compiling all projects created in the last 24 hours (just make sure to adjust the time threshold in main.py to 24 hours as well!).
Conclusion
By building this project, you have created
a powerful, zero-cost, and low-maintenance tool. You did not have to configure
an email server, purchase cloud hosting, or manage complex infrastructure. By
using GitHub Actions and GitHub Issues, you let GitHub handle the computing
power, scheduling, and email delivery for you. You can now relax and watch the
latest AI innovations deliver themselves straight to your inbox. Happy coding!
Join the conversation