Public
Like
GitHubIssuesToClay
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v74View latest version
Extract GitHub issue authors' emails and send them to Clay for enrichment.
This API fetches all issues from a GitHub repository, extracts unique author usernames, finds their email addresses, and sends the data to Clay for further enrichment.
const response = await fetch("https://your-val-url.web.val.run", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
githubRepo: "sourcebot-dev/sourcebot",
clayWebhookUrl: Deno.env.get("CLAY_WEBHOOK_URL"),
githubToken: Deno.env.get("GITHUB_TOKEN"),
limit: 10
})
});
const result = await response.json();
console.log(result);
// { success: true, processed: 15 }
githubRepo
- Required - Repository in format "owner/repo"clayWebhookUrl
- Required - Your Clay webhook URL for data enrichmentgithubToken
- Required - GitHub Personal Access Tokenlimit
- Optional - Maximum number of unique authors to process (default: 10)
- Fetches Issues: Retrieves all issues from the specified GitHub repository
- Extracts Authors: Gets unique author usernames from the issues
- Finds Emails: Uses GitHub API to find email addresses for each author
- Sends to Clay: Sends each email with metadata to your Clay webhook for enrichment
Each record sent to Clay contains:
github_username
- The GitHub usernameemail
- The email address found for the usersource_repo
- The repository the issues came from
Create a GitHub Personal Access Token with repo
access:
- Go to GitHub Settings > Developer settings > Personal access tokens
- Generate new token with
repo
scope - Set as
GITHUB_TOKEN
environment variable
- Create a Clay table for enrichment
- Set up a webhook endpoint in Clay
- Use the webhook URL as
clayWebhookUrl
parameter