Search icon
IonToJson icon
Log icon

Search GitHub org and log most starred repo

Search GitHub repositories across an organization with Kestra, convert results to JSON, and log the most starred repo. Automate GitHub data collection in YAML.

Categories
Business
id: github-search
namespace: company.team

tasks:
  - id: top_kestra_repos
    type: io.kestra.plugin.github.repositories.Search
    query: "org:kestra-io"
    visibility: PUBLIC
    sort: STARS
    order: DESC

  - id: to_json
    type: io.kestra.plugin.serdes.json.IonToJson
    from: "{{ outputs.top_kestra_repos.uri }}"

  - id: log_json
    type: io.kestra.plugin.core.log.Log
    message: "{{ read(outputs.to_json.uri) | jq('.name') | first }}"

Pull a live snapshot of a GitHub organization's repositories without writing a custom API client. This blueprint queries the GitHub Search API for every public repo in an org, sorts them by star count, converts the results into clean JSON, and logs the name of the most popular project. It solves the common problem of turning ad hoc gh CLI calls and scratch scripts into a repeatable, observable workflow you can schedule, audit, and extend.

How it works

  1. The top_kestra_repos task (io.kestra.plugin.github.repositories.Search) runs the query org:kestra-io with visibility: PUBLIC, sort: STARS, and order: DESC, returning repositories ranked from most to least starred.
  2. The to_json task (io.kestra.plugin.serdes.json.IonToJson) converts the Ion output stored at outputs.top_kestra_repos.uri into standard JSON for easy parsing.
  3. The log_json task (io.kestra.plugin.core.log.Log) reads the JSON, applies jq('.name'), takes the first entry, and logs the name of the top repository.

What you get

  • A ranked, structured list of an organization's public repositories.
  • JSON output ready to feed into downstream tasks, files, or databases.
  • A clear log line surfacing the single most starred repo.
  • A reusable pattern for any GitHub Search query, not just stars.

Who it's for

  • Developer relations and OSS maintainers tracking project popularity.
  • Platform and data engineers building GitHub reporting pipelines.
  • Anyone replacing throwaway scripts with a managed workflow.

Why orchestrate this with Kestra

The GitHub API has no built-in scheduler, retry logic, or run history. Kestra adds declarative YAML, event and schedule triggers, automatic retries on rate limits or transient failures, full execution lineage, and outputs that pass cleanly between tasks. You get a durable, observable record of every search instead of a one-off command in your terminal.

Prerequisites

  • A running Kestra instance.
  • Network access to the public GitHub API.

Secrets

This blueprint targets public repositories and requires no secrets or authentication. To raise rate limits or query private repos, add a GitHub token via the plugin's authentication properties.

Quick start

  1. Add this flow to your Kestra instance.
  2. Change the query value to your own org, for example org:your-org.
  3. Execute the flow and open the Logs tab to see the top repository name.
  4. Inspect the to_json output to view the full ranked list.

How to extend

  • Swap the query to filter by language, topic, or date pushed.
  • Add a io.kestra.plugin.core.trigger.Schedule trigger to refresh daily.
  • Persist the JSON to storage or load it into a warehouse for trend analysis.
  • Branch on results to alert a Slack channel when a new repo tops the list.

Links

Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.