github

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

README

GitHub

Extract metadata from a GitHub organisation including users, repositories, teams, and documents.

Usage

source:
  name: github
  scope: my-github-org
  config:
    org: raystack
    token: github_token
    extract:
      - users
      - repositories
      - teams
      - documents
    # docs configures document extraction (only used when "documents" is in extract).
    docs:
      repos: ["meteor"]
      paths: ["docs"]
      pattern: "*.md"

Configuration

Key Type Required Description
org string Yes Name of the GitHub organisation.
token string Yes GitHub API access token.
extract []string No Entity types to extract. Defaults to all: users, repositories, teams, documents, collaborators.
docs.repos []string No Repositories to scan for documents. Defaults to all org repos.
docs.paths []string No Directory paths to scan within each repo. Defaults to ["docs"].
docs.pattern string No Glob pattern to match files. Defaults to "*.md".

Entities

The extractor emits four entity types and their relationships as edges.

Entity: user
Field Sample Value
urn urn:github:my-org:user:MDQ6VXNl...
name Ravi Suhag
properties.email suhag.ravi@gmail.com
properties.username ravisuhag
properties.full_name Ravi Suhag
properties.company Raystack
properties.location Bangalore
properties.bio Engineer
properties.status active
Entity: repository
Field Sample Value
urn urn:github:my-org:repository:R_kgDO...
name meteor
properties.full_name raystack/meteor
properties.language Go
properties.visibility public
properties.default_branch main
properties.archived false
properties.stargazers 42
properties.forks 5
properties.topics ["metadata", "golang"]
Entity: team
Field Sample Value
urn urn:github:my-org:team:T_lADO...
name Backend
properties.slug backend
properties.description Backend engineering team
properties.privacy closed
properties.permission push
Entity: document
Field Sample Value
urn urn:github:my-org:document:abc123...
name getting-started
properties.path docs/getting-started.md
properties.file_name getting-started.md
properties.content # Getting Started\n...
properties.html_url https://github.com/raystack/meteor/blob/main/docs/...
properties.repo raystack/meteor
properties.size 2048
properties.sha abc123def456...
Edges
Type Source Target Description
member_of user org User is a member of the organisation
owned_by repository user Repository is owned by a user
member_of user team User is a member of a team
belongs_to document repository Document belongs to a repository
has_access_to user repository User has access to a repository (properties: permission)
Collaborator Permissions

When collaborators is included in extract, the extractor lists collaborators for each repository and emits has_access_to edges with a permission property indicating the highest access level: admin, maintain, push, triage, or pull.

Contributing

Refer to the contribution guidelines for information on contributing to this module.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Org     string     `json:"org" yaml:"org" mapstructure:"org" validate:"required"`
	Token   string     `json:"token" yaml:"token" mapstructure:"token" validate:"required"`
	Extract []string   `` /* 133-byte string literal not displayed */
	Docs    DocsConfig `json:"docs" yaml:"docs" mapstructure:"docs"`
}

type DocsConfig added in v0.13.0

type DocsConfig struct {
	Repos   []string `json:"repos" yaml:"repos" mapstructure:"repos"`
	Paths   []string `json:"paths" yaml:"paths" mapstructure:"paths"`
	Pattern string   `json:"pattern" yaml:"pattern" mapstructure:"pattern"`
}

type Extractor

type Extractor struct {
	plugins.BaseExtractor
	// contains filtered or unexported fields
}

func New

func New(logger log.Logger) *Extractor

func (*Extractor) Extract

func (e *Extractor) Extract(ctx context.Context, emit plugins.Emit) error

func (*Extractor) Init

func (e *Extractor) Init(ctx context.Context, config plugins.Config) error

func (*Extractor) SetBaseURL added in v0.13.0

func (e *Extractor) SetBaseURL(url string)

SetBaseURL overrides the GitHub API base URL (used for testing).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL