Yoname / github-fork-notifier

When a fork for your GitHub repo, send me a Slack message and save the fork to Airtable

Home Page:https://flows.network/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub Fork Notifier

flows.network Discord flows.network Twitter Create a flow

Deploy this function on flows.network, and you will get an automated workflow: When someone forks your GitHub repo, you will get a Slack message, meawhile this fork record is saved to a form on Airtable. It helps DevRels and Community Managers to stay on top of the growth of their GitHub communities.

Github fork to slack

Save GitHub fork to Airtable

Prerequisite

Deploy the GitHub fork notifier

To create this fork notifier, we will use flows.network, a serverless platform that makes deploying your own app quick and easy in just 3 steps.

Fork this repo and cutomize the code

Fork this repo and customize the code based on your needs. Since this function involes three SaaS integrations, so we need to change the code as the following.

  1. GitHub: Replace WasmEdge and WasmEdge with your own GitHub repo you want to monitor for the fork data.
pub async fn run() {
    let owner = "WasmEdge";
    let repo = "WasmEdge";

    listen_to_event(owner, repo, vec!["fork"], handler).await;
}
  1. Airtable: Change the parameters for Airtable based on the code comment. This is where you save the new fork.
async fn handler(payload: EventPayload) {
    let account: &str = "github"; // The name that you will name your Airtable API key in the SaaS configuration step. You can get this from Airtable.
    let base_id: &str = "appNEswczILgUsxML"; // This is the base where you want to record new forks. You can get this from Airtable easily. Please refer to https://support.airtable.com/docs/finding-airtable-ids#finding-ids-in-airtable-api
    let table_name: &str = "fork"; // This the table name in the above base. If you're using the template that we provide, then don't need to change this.
  1. Slack: Replace secondstate and github-status with your own Slack workaspace and channel. This is where you get the new fork message.
let text = format!("{} forked your {}\n{}", name, html_url, time);
send_message_to_channel("secondstate", "github-status", text);

Deploy the code on flow.network

Next, let us deploy this repo on flows.network.

  1. Sign up for an accoun on flows.network. It's a free platform for deploying automation workflows.
  2. Click on the "Create a Flow" button to start deploying this function
  3. Authenticate the flows.network to access the github-fork-notifier repo you just forked.

image

  1. Click the Deploy button to deploy your function.

Configure SaaS integrations

After that, the flows.network will direct you to configure the SaaS integrations required by your flow.

image

Here we can see, we need to configue three SaaS integrations.

  1. Click the "Connect/+ Add new authentication" button to authenticate your Slack account. You'll be redirected to a new page where you must grant flows.network permission to install the flows-network-integration bot on your workspace. This workspace is the one you changed in the code above.

  2. Click the "Connect/+ Add new authentication" button to authenticate your Airtable account. You'll be redirected to a new page where you can copy and paste your Airtable API key and then name the key. Note that the name you enter here should be the same as the name you changed in the code above.

image

  1. Click the "Connect/+ Add new authentication" button to authenticate your GitHub account. You'll be redirected to a new page where you must grant flows.network permission to install the flows-network-integration bot on the repo that you changed in the code above.

After that, click the Check button to see your flow details. As soon as the flow function's status becomes ready and the flow's status becomes running, the flow goes live. Whenever a GitHub user forks your repo, you will get a Slack notifitaion and a new record in your Airtable. image

flows.network is still in its early stages. We would love to hear your feedback!

About

When a fork for your GitHub repo, send me a Slack message and save the fork to Airtable

https://flows.network/


Languages

Language:Rust 100.0%