In this post, we’ll cover how to get custom reports from GitHub issues, PRs, and commits using Nekton AI and GitHub API.
Let’s start with a report showing the number of active GitHub PRs per user. It can be useful if you want to find the least busy person to assign a PR to or see who is overloaded on the team.
The final result will look like this:
![](https://nekton.ai/blog/wp-content/uploads/2023/10/image-1024x585.png)
You can try it out:
- Run it on a public repo
- Use it on a private repo – clone this flow and authenticate to GitHub
How to make a custom GitHub report
We start by creating a new workflow in Nekton and adding a form that asks for the name of the GitHub repo.
After that, I’ll add an automated step, and describe what needs to be done: “Create a report of how many active PRs there are for each user of GitHub repo. Format it as a table, and show the least busy users on top.”
![](https://nekton.ai/blog/wp-content/uploads/2023/10/image-1-1024x507.png)
Nekton AI will generate Typescript code to implement this task. It will use GitHub API to get the information about PRs and then format them as a markdown table.
![](https://nekton.ai/blog/wp-content/uploads/2023/10/image-2-1024x725.png)
With AI code generation, I don’t need to spend an hour learning the API for for one-off small task, and I can get a working automation in less than a minute. Nekton runs this automation in the cloud, and I can share a link to it with other people. You can also review and modify the code before running it.
This automation will work well with public repos, but it wouldn’t connect to a private one, because it needs authentication. We can add it quite easily by chatting with Nekton AI. I just say “Authenticate to Github with OAuth” in the automation chat, and Nekton modifies the code:
![](https://nekton.ai/blog/wp-content/uploads/2023/10/image-3-1024x469.png)
I can then connect this workflow to GitHub using OAuth, and run it for private repos.
Next steps
You can try running and modding this automation: template for public repo, template for private repo.
You can also try automating your other GitHub day-to-day tasks with Nekton. For example, you can assign PRs to a least busy person, or send this report over email on a schedule.
Leave a Reply