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.
- A Slack Account
- An Airtable account, an Airtable API Key and also a base to record the new forks. For the form, you can simply copy the template base.
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 customize the code based on your needs. Since this function involes three SaaS integrations, so we need to change the code as the following.
- GitHub: Replace
WasmEdge
andWasmEdge
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;
}
- 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.
- Slack: Replace
secondstate
andgithub-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);
Next, let us deploy this repo on flows.network.
- Sign up for an accoun on flows.network. It's a free platform for deploying automation workflows.
- Click on the "Create a Flow" button to start deploying this function
- Authenticate the flows.network to access the
github-fork-notifier
repo you just forked.
- Click the Deploy button to deploy your function.
After that, the flows.network will direct you to configure the SaaS integrations required by your flow.
Here we can see, we need to configue three SaaS integrations.
-
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. -
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.
- 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.
flows.network is still in its early stages. We would love to hear your feedback!