Next-level marketing engineering with Zapier and ChatGPT

04 March 2023

Automate LinkedIn with GitHub messages
Photo by markuswinkler

I am releasing a book about the React Native ecosystem, which covers everything I wish I had known before I started working with this technology.

If you appreciate my work and would like to show your support, please check the Road to React Native.

"How long will it take?" and "What have you done today?" are two questions that developers often dislike answering.

The first question is difficult to answer because it depends on various factors, such as the project's context, maturity, and team.

The second question is even more challenging to explain to clients or stakeholders. It can be difficult to clarify the differences between bug fixes and features, as well as how Git works.

Producing engineering marketing content takes forever.

I don't have time for this.

I don’t understand how people can be so active on LinkedIn.

As an engineer, my priority is to ship features to production.

I do have time to read nice CHANGELOG.md that are half-automated based on commit messages. This helps me stay up-to-date with the latest API changes.

Wait a minute.

What if I could automate the publication of LinkedIn messages…

…based on my git history?

Let me introduce you “GitHub to LinkedIn” powered by ChatGPT.

Transform this commit message...

Simple message commit from GitHub

... into a human friendly LinkedIn publication.

GitHub commit transformed into LinkedIn message with ChatGPT

How we can achieve this black magic?

The art of a good commit message

If you are a junior developer, the first skill you must acquire when working as a team is writing meaningful commit messages.

Consistency over time is essential for messages.

// Do this
✅ add contact link on homepage

// Don't do that
// or if you do that use git rebase to keep only one commit at the end
❌ test
❌ finish tuto
❌ Add css

The first step is to install commitizen in your repository. This will ensure that you and your team use the same commit format.

npm install -g commitizen git-cz
commitizen init git-cz --save-dev --save-exact

Now, when you run

git cz

the cli asks you to answer a number of questions and add the issue you want to solve

use git-cz to create consistency in commit messages

You can customize your configuration for git-cz. Here is my configuration, which is designed to make the commit process faster and more straightforward. I prefer to avoid wasting time on lengthy or complicated questions.

// changelog.config.js

module.exports = {
list: ['feat', 'fix', 'test', 'refactor', 'chore', 'docs'],
maxMessageLength: 64,
minMessageLength: 3,
questions: ['type', 'subject', 'breaking', 'issues'],
};

Now that we have consistent and well-formatted commit messages, we can use ChatGPT to automate the translations of git message for non-technical people.

Setup your ChatGPT account

You need to create an OpenAI account first, and I suggest you set limits to avoid losing all your money doing random mistakes.

Set limits to the API usage to prevent it from growing too fast

As an individual, it can be easy to get excited about the potential of an API and want to unleash its full capabilities. Without proper limits, the API could grow uncontrollably and skyrocket your invoice.

https://platform.openai.com/account/billing/limits

open ai usage limits

Let’s start with a very low limit, just in case 🤣

Learn the GPT-3 models

Here is a link to the GPT-3 documentation on the OpenAI platform: https://platform.openai.com/docs/models/gpt-3

This documentation provides information on the GPT-3 models and how they can be used. It is a helpful resource for anyone looking to learn more about GPT-3 and its capabilities.

For our usage, we will need to use text-davinci-003. (There is probably a better solution, but we need to start somewhere)

Translate the commit message into an engaging LinkedIn message with a call to action

To connect GitHub, ChatGPT, and LinkedIn, we will use my favorite service of all time: Zapier. This service will facilitate the integration process and make it easier for us to connect these platforms.

Create a new Zap

From your zapier dashboard, create a new zap. Zaps are the connections between applications that enable you to automate tasks and streamline your workflow.

make your first zap on zapier

With Zapier, you can create Zaps that connect over 3,000 different apps, allowing you to automate a wide range of tasks and processes.

Set up your GitHub trigger

To begin, set up your trigger—the event that starts your Zap—by selecting GitHub as your trigger app and New Commit as your trigger event.

New Commit as trigger event for your zap

If you haven't already, you'll be asked to connect your GitHub account. Click on Choose an account… to continue.

Now you can select your repository. I decided to use the monorepo we use in my company https://github.com/flexbox/weshipit.today and the trigger will only happen with the main branch.

We don't want to be too spammy.

zap GitHub select repository

Click Continue.

It will pull in the sample data with the commit informations. Once you see that your trigger is working correctly, click Continue.

zap github test action

I take credit for my coworkers' commit because I am the CEO.

Set up your OpenAI action

Now it's time to set up the action that your Zap will perform once it's triggered.

  1. Select OpenAI as your action app.
  2. Choose Send Prompt as your action event.
  3. Click Continue to proceed.

zap openai setup

If you haven't already, you'll be asked to connect your GitHub account. Click on Choose an account… to continue.

You will need to add an api key from https://platform.openai.com/

openai view API keys

Create on Create new secret key, and paste it on the Zapier modal.

openai create a new API key

Then, you need to tell your Zap how to generate the content of your Link.

  1. Select your model. We decided to use text-davinci-003 previously.
  2. Then, add your prompt and include the value of your commit message.
  3. Choose a temperature between 0 and 1.

zap openai add prompt

Once you've finished customizing these fields, click Continue.

Now it's time to test your action. When you click Test & Review or Test & Continue, Zapier will pull in the prompt from OpenAI according to how you customized the fields in your Zap.

zap openai test result

Set up you LinkedIn action

Click on + to add a new action and select LinkedIn

zap linkedin add action

We have almost finished, now we need to choose the event Create Share Update

zap linkedin create share update

Click Continue.

If you haven't already, you'll be asked to connect your LinkedIn account. Click on Choose an account… to continue.

Click on the comment textarea to add the result from the ChatGPT prompt.

zap linkedin comment add promt result from ChatGPT

Now it's time to test your action. Click Test action. Zapier will share a message on your LinkedIn profile.

zap linkedin test action

Once you have reviewed the result by your Zap, it is ready to use. If something appears to be incorrect, go back, make adjustments and Retest action until it is just right.

How to prompt like a 10x engineer

At first, I took a very naive approach, and the results were not good.

openai bad prompt result in poor LinkedIn message

After realizing my initial approach wasn't effective, I decided to take a step back and reassess my strategy.

By 2023, the most important skill for any developer will be the ability to read documentation. I spent some time reading the OpenAI cookbook, and I highly recommend that you do the same.

https://github.com/openai/openai-cookbook

In the end, I arrived at this solution.

You are a friendly and helpful freelance react developer working on this website <https://weshipit.today/>
You explain concepts in great depth using simple terms, and you give examples to help people learn.
At the end of each explanation, you ask a question to check for understanding.

Here is a commit message:
```
// insert commit message here
```

Can you translate the commit message into an engaging LinkedIn message?

It must be:
- easy to understand for non-technical people
- add a call to action at the end of the message

Which creates more delightful results.

GitHub commit transformed into LinkedIn message with ChatGPT

Use OpenAI for marketing engineering

Now, every time you merge a pull request to your main branch, this Zap will automatically create a post on LinkedIn. All you have to do is maintain a clean git history.

You won't have to worry about your wording or whether you come across as professional, as your GPT-3 prompt will take care of that for you.

This will allow you to focus on writing more code.

Happy Hacking!

Gravatar for dleuliette@gmail.com

Hi, I’m David, a french freelance developer working remotely. I’m the author of this blog, nice to meet you!

Subscribe?

Be the first to receive insightful articles and actionable resources that help you to elevate your skills.