Skip to content
Home ยป ChatGPT Chats to GitHub

ChatGPT Chats to GitHub



For: Me

Project Goal

This project automates the process of taking text generated by ChatGPT and saving it as a file within a specified GitHub repository. It also integrates with Make.com to optionally trigger additional workflows when the generated text is flagged as a blog post. The goal is to streamline content creation workflows by directly connecting AI-generated text with version control and other backend systems.

How it was built

The core of this project is a Python function deployed as a Google Cloud Function. It receives JSON data, including the file title, content, and target repository name. The function utilizes the PyGithub library to authenticate with GitHub using an access token. It then iterates through the user’s repositories to find the one specified in the payload and creates a new file with the provided title and content. The function also detects if the content contains ‘[BLOG]’ and if it does, it triggers a Make.com scenario using a webhook to perform further actions. The Make.com scenario is triggered by a trigger_scenario() function, which sends a POST request to a Make.com webhook with the file content and title.

Technologies used

  • Python: The primary language used for the cloud function and logic.
  • Google Cloud Functions: Serverless environment to run the Python code.
  • PyGithub: Python library to interact with the GitHub API.
  • Make.com: Integration platform to automate further workflows.
  • HTTP Requests: Used for calling the Make.com API.
  • JSON: Data format for receiving and sending data between different services.

Leave a Reply

Your email address will not be published. Required fields are marked *