Skip to main content

Github

GitHub is a web-based platform for version control, source code management, and collaborative software development. This integration provides comprehensive access to GitHub's organizational data, repositories, workflows, security features, and audit capabilities, enabling teams to query and analyze their entire GitHub environment for security, compliance, DevOps, and operational insights.

CategorySource control & CI/CD
DirectionQuery source
Sign-inAccess Token
Query languagesSQLite
Tables71
Query templates251
Websitegithub.com

Before you start​

Huntbase signs in to Github with Access Token. Create the credential in Github first, then keep it to hand for the Connect step.

  1. In GitHub, go to Settings › Developer settings › Personal access tokens › Fine-grained tokens and click Generate new token.
  2. Enter a token name and pick an expiration date.
  3. Under Resource owner, select the user or organization whose data you want to query. If the organization requires approval, enter a justification.
  4. Choose the repository access and grant read-only permissions for the data you want to query, then click Generate token and copy it.

Permissions:

  • If you use a classic token instead (Tokens (classic)), grant repo, read:org, gist, read:user and user:email.
Watch out for
  • A fine-grained token can only access resources owned by the resource owner you select when you create it.
  • The classic repo scope includes write access. Use a fine-grained token with read-only permissions when you can.

For the vendor's own instructions, see GitHub personal access token documentation.

tip

Use a dedicated, read-only credential for Huntbase where the product allows it. Huntbase only needs to read.

Connect Github​

  1. Go to Connections and click New connection, or click New connection on the Github product page.
  2. On Product, pick Github and choose the Owner.
  3. On Details, give the connection a Name and, optionally, a Description.
  4. On Connect, fill in the settings and credentials described below.
  5. On Verify, review the summary and click Create & check.

For everything else on the setup page — saving a draft, I'll do this later, and what each check result means — see Connections.

Settings​

Where your Github lives:

FieldRequiredNotes
Base URL (for GitHub Enterprise)NoLeave blank for github.com. For GitHub Enterprise Server, enter your instance URL, such as https://github.example.com.
GitHub App IDNo
GitHub App Installation IDNo

Credentials​

The only Method is Access Token. Enter a Credential label (for example Production), then fill in:

FieldRequiredNotes
Access TokenYesSecret — not shown again after you save it.

Query it​

Once connected, Github can serve these languages in a query tab, and Scout can use it when you ask in Auto:

LanguageUse it for
SQLiteSQL over the 71 tables listed below, alongside every other connected source.

Example: SQLite​

List your gists — Identify and review all the gists you have created on GitHub.

select
*
from
github_my_gist;

Github ships with 251 query templates. Find them in Library › Queries — see Query templates.

What syncs automatically​

Github comes with a content pack. These queries run on a schedule on each new connection so the entities they find appear in the Activity Feed without you asking. You can turn syncing off from the connection's Synchronisation Settings card.

QueryFinds
Sync repositoriesresource, user
Sync organization membersorganization, user
Sync SAML identitiesorganization, user, url
Sync teamsgroup, organization
Sync repository collaboratorsuser, resource
Sync organization security settingsorganization

Tables​

Github adds 71 tables. Browse their columns from Schema in the query bar's ⋯ menu.

All 71 tables
TableContains
github_actions_artifactArtifacts allow you to share data between jobs in a workflow and store data once that workflow has completed.
github_actions_cacheCaches are a built-in storage mechanism to speed up jobs in a workflow by persisting data for re-use.
github_actions_environment_variableVariables are unencrypted environment variables that you create in a repository environment for use in GitHub Actions workflows.
github_actions_organization_variableVariables are unencrypted environment variables created in an organization for use in GitHub Actions workflows.
github_actions_repository_runnerThe runner is the application that runs a job from a GitHub Actions workflow
github_actions_repository_secretSecrets are encrypted environment variables that you create in a repository
github_actions_repository_variableVariables are unencrypted environment variables created in a repository for use in GitHub Actions workflows.
github_actions_repository_workflow_jobWorkflowJob represents a repository action workflow job
github_actions_repository_workflow_runWorkflowRun represents a repository action workflow run
github_audit_logGets the audit logs for an organization.
github_blobGets a blob from a repository.
github_branchBranches in the given repository.
github_branch_protectionBranch protection defines rules for pushing to and managing a branch.
github_code_ownerIndividuals or teams that are responsible for code in a repository.
github_commitGitHub Commits bundle project files for download by users.
github_community_profileCommunity profile information for the given repository.
github_gistGitHub Gist is a simple way to share snippets and pastes with others.
github_gitignoreGitHub defined .gitignore templates that you can associate with your repository.
github_issueGitHub Issues are used to track ideas, enhancements, tasks, or bugs for work on GitHub.
github_issue_commentGitHub Issue Comments are the responses/comments on GitHub Issues.
github_licenseGitHub Licenses are common software licenses that you can associate with your repository.
github_my_gistGitHub Gists owned by you. GitHub Gist is a simple way to share snippets and pastes with others.
github_my_issueGitHub Issues owned by you. GitHub Issues are used to track ideas, enhancements, tasks, or bugs for work on GitHub.
github_my_organizationGitHub Organizations that you are a member of. GitHub Organizations are shared accounts where businesses and open-source projects can collaborate across many projects at once.
github_my_repositoryGitHub Repositories that you are associated with. GitHub Repositories contain all of your project's files and each file's revision history.
github_my_starGitHub stars owned by you. GitHub stars are repositories.
github_my_teamGitHub Teams that you belong to in your organization. GitHub Teams are groups of organization members that reflect your company or group's structure with cascading access permissions and mentions.
github_organizationGitHub Organizations are shared accounts where businesses and open-source projects can collaborate across many projects at once.
github_organization_collaboratorGitHub members for a given organization. GitHub Users are user accounts in GitHub.
github_organization_dependabot_alertDependabot alerts from an organization.
github_organization_external_identityGitHub members for a given organization. GitHub Users are user accounts in GitHub.
github_organization_memberGitHub members for a given organization. GitHub Users are user accounts in GitHub.
github_organization_rulesetRetrieve the rulesets of a specified GitHub organization.
github_packageGitHub Packages allow you to store and manage packages such as container images or other artifacts in your GitHub repositories.
github_package_versionGitHub Packages allow you to store and manage packages such as container images or other artifacts in your GitHub repositories.
github_pull_requestGitHub Pull requests let you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.
github_pull_request_commentComments are the responses/comments on Pull Requests.
github_pull_request_reviewPull Request Reviews are groups of pull request review comments on a pull request.
github_rate_limitRate limit of github.
github_rate_limit_graphqlRate limit information for GitHub GraphQL API endpoint.
github_releaseGitHub Releases bundle project files for download by users.
github_repositoryGitHub Repositories contain all of your project's files and each file's revision history.
github_repository_collaboratorCollaborators are users that have contributed to the repository.
github_repository_contentList the content in a repository (list directory, or get file content
github_repository_dependabot_alertDependabot alerts from a repository.
github_repository_deploymentGitHub Deployments are releases of the app/service/etc to an environment.
github_repository_discussionGitHub Discussions are conversations that can be started by anyone and are organized into categories.
github_repository_environmentGitHub Environments are named deployment targets, usually isolated for usage such as test, prod, staging, etc.
github_repository_rulesetRetrieve the rulesets of a specified GitHub repository.
github_repository_sbomGet the software bill of materials (SBOM) for a repository.
github_repository_vulnerability_alertVulnerability Alerts from a repository.
github_search_codeSearches for query terms inside of a file.
github_search_commitFind commits via various criteria on the default branch (usually master).
github_search_issueFind issues by state and keyword.
github_search_labelFind labels in a repository with names or descriptions that match search keywords.
github_search_pull_requestFind pull requests by state and keyword.
github_search_repositoryFind repositories via various criteria.
github_search_topicFind topics via various criteria.
github_search_userFind users via various criteria.
github_stargazerStargazers are users who have starred the repository.
github_tagTags for commits in the given repository.
github_teamGitHub Teams in a given organization. GitHub Teams are groups of organization members that reflect your company or group's structure with cascading access permissions and mentions.
github_team_memberGitHub members for a given team. GitHub Users are user accounts in GitHub.
github_team_repositoryGitHub Repositories that a given team is associated with. GitHub Repositories contain all of your project's files and each file's revision history.
github_traffic_clone_dailyDaily traffic clone stats over the last 14 days for the given repository.
github_traffic_clone_weeklyWeekly traffic clone stats over the last 14 days for the given repository.
github_traffic_view_dailyDaily traffic view over the last 14 days for the given repository.
github_traffic_view_weeklyWeekly traffic view over the last 14 days for the given repository.
github_treeLists directories and files in the given repository's git tree.
github_userGitHub Users are user accounts in GitHub.
github_workflowGitHub Workflows bundle project files for download by users.

Next steps​