- BranchProtections
- BranchRules
- CodeScanningAlerts
- DependabotAlerts
- RepositoryDetails
- RepositoryLanguages
- SecretScanningAlerts
- SecurityAdvisories
Prerequisites
Configure GitHub integration in Backstage
Integrations are configured at the root level ofapp-config.yaml. Here’s an example configuration for GitHub:
Add the GitHubFactCollector to Soundcheck
GitHub integration for Soundcheck is not installed by default. It must be manually installed and configured for the GitHub Fact Collector to work. First, add the@spotify/backstage-plugin-soundcheck-backend-module-github package:
packages/backend/src/index.ts file:
packages/backend/src/index.ts
Entity configuration
To be able to determine the repository to use the GitHub integration will use the value from thebackstage.io/source-location annotation. In many cases this will be set for you but if it is not you will need to add it to your catalog-info.yaml file, here’s a simple example:
Plugin Configuration
The collection of facts is driven by configuration. To learn more about the configuration, jump to the Defining GitHub Fact Collectors section. GitHub Fact Collector can be configured via YAML or No-Code UI. If you configure it via both YAML and No-Code UI, the configurations will be merged. It’s preferable to choose a single source for the Fact Collectors configuration (either No-Code UI or YAML) to avoid confusing merge results.No-Code UI Configuration Option
- Make sure the prerequisite Configure GitHub integration in Backstage is completed and GitHub instance details are configured.
-
To enable the GitHub Integration, go to
Soundcheck > Integrations > GitHuband click theConfigurebutton. To learn more about the No-Code UI config, see the Configuring a fact collector (integration) via the no-code UI.

YAML Configuration Option
-
Create a
github-facts-collectors.yamlfile in the root of your Backstage repository and fill in all your GitHub Fact Collectors. A simple example GitHub Fact Collector is listed below.Note: this file will be loaded at runtime along with the rest of your Backstage configuration files. Therefore, make sure that it’s available in deployed environments in the same way as yourapp-config.yamlfiles are. -
Add a soundcheck collectors field to
app-config.yamland reference the newly createdgithub-facts-collectors.yaml
Rate Limiting (Optional)
This fact collector can be rate limited in Soundcheck using the following configuration:Defining GitHub Fact Collectors
This section describes the data shape and semantics of GitHub Fact Collectors.Overall Shape Of A GitHub Fact Collector
The following is an example of a descriptor file for a GitHub Fact Collector:frequency [optional]
The frequency at which the collector should be executed. Possible values are either a cron expression { cron: ... } or HumanDuration.
This is the default frequency for each collector.
initialDelay [optional]
The amount of time that should pass before the first invocation happens. Possible values are either a cron expression { cron: ... } or HumanDuration.
batchSize [optional]
The number of entities to collect facts for at once. Optional, the default value is 1.
Note: Fact collection for a batch of entities is still considered as one hit towards the rate limits
by the Soundcheck Rate Limiting engine, while the actual number of hits
will be equal to the batchSize.
Example:
filter [optional]
A filter specifying which entities to collect the specified facts for. Matches the filter format used by the Catalog API.
This is the default filter for each collector.
See filters for more details.
exclude [optional]
Entities matching this filter will be skipped during the fact collection process. Can be used in combination with filter. Matches the filter format used by the Catalog API.
cache [optional]
If the collected facts should be cached, and if so for how long. Possible values are either true or false or a nested { duration: HumanDuration } field.
This is the default cache config for each collector.
collects [required]
An array describing which facts to collect and how to collect them. See below for details about the overall shape of a fact collector.
Overall Shape Of A Fact Collector
Each collector supports the fields described below.factName [required]
The name of the fact to be collected.
- Minimum length of 1
- Maximum length of 100
- Alphanumeric with single separator instances of periods, dashes, underscores, or forward slashes
type [required]
The type of the collector (e.g. BranchProtections, RepositoryDetails).
frequency [optional]
The frequency at which the fact collection should be executed. Possible values are either a cron expression { cron: ... } or HumanDuration.
If provided, it overrides the default frequency provided at the top level. If not provided, it defaults to the frequency provided at the top level. If neither collector’s frequency, nor default frequency is provided, the fact will only be collected on demand.
Example:
batchSize [optional]
The number of entities to collect facts for at once. Optional, the default value is 1.
If provided it overrides the default batchSize provided at the top level. If not provided it defaults to the batchSize provided at the top level. If neither collector’s batchSize nor default batchSize is provided the fact will be collected for one entity at a time.
Note: Fact collection for a batch of entities is still considered as one hit towards the rate limits
by the Soundcheck Rate Limiting engine, while the actual number of hits
will be equal to the batchSize.
Example:
filter [optional]
A filter specifying which entities to collect the specified facts for. Matches the filter format used by the Catalog API.
If provided, it overrides the default filter provided at the top level. If not provided, it defaults to the filter provided at the top level. If neither collector’s filter, nor default filter is provided, the fact will be collected for all entities.
exclude [optional]
Entities matching this filter will be skipped during the fact collection process. Can be used in combination with filter. Matches the filter format used by the Catalog API.
cache [optional]
If the collected facts should be cached, and if so for how long. Possible values are either true or false or a nested { duration: HumanDuration } field.
If provided, it overrides the default cache config provided at the top level. If not provided, it defaults to the cache config provided at the top level. If neither collector’s cache nor default cache config is provided, the fact will not be cached.
Example:
Collecting BranchProtections Fact
TheBranchProtections fact contains information about configured branch protections for a default branch in a GitHub repository.
Prerequisites:
- Grant your GitHub app or access token with necessary permissions listed in the Get branch protection GitHub API documentation.
Shape of A BranchProtections Fact Collector
The shape of a BranchProtections Fact Collector matches the Overall Shape Of A Fact Collector (restriction:type: BranchProtections).
The following is an example of the BranchProtections Fact Collector configuration:
Shape of A BranchProtections Fact
The shape of aBranchProtections Fact is based on the Fact Schema.
For a description of the data collected regarding branch protection, refer to the GitHub API documentation.
The following is an example of the collected BranchProtections fact:
Shape of A BranchProtections Fact Check
The shape of aBranchProtections Fact Check matches the Shape of a Fact Check.
The following is an example of the BranchProtections fact checks:
Collecting BranchRules Fact
TheBranchRules fact contains information about configured branch rules for a default branch in a GitHub repository.
Prerequisites:
- Grant your GitHub app or access token with necessary permissions listed in the Get rules for a branch GitHub API documentation.
Shape of A BranchRules Fact Collector
The shape of a BranchRules Fact Collector matches the Overall Shape Of A Fact Collector (restriction:type: BranchRules).
The following is an example of the BranchRules Fact Collector configuration:
Shape of A BranchRules Fact
The shape of aBranchRules Fact is based on the Fact Schema.
For a description of the data collected regarding branch rules, refer to the GitHub API documentation.
The following is an example of the collected BranchRules fact:
Shape of A BranchRules Fact Check
The shape of aBranchRules Fact Check matches the Shape of a Fact Check.
The following is an example of the BranchRules fact checks:
Collecting CodeScanningAlerts Fact
TheCodeScanningAlerts fact contains information about code scanning alerts for a default branch in a GitHub repository.
Prerequisites:
- In order to be able to collect code scanning alerts you must enable them in GitHub, refer to the GitHub Code Scanning documentation.
- Grant your GitHub app or access token with necessary permissions listed in the List code scanning alerts for a repository GitHub API documentation.
This is a sensitive fact. See docs for more
details.
Shape of A CodeScanningAlerts Fact Collector
The shape of a CodeScanningAlerts Fact Collector matches the Overall Shape Of A Fact Collector (restriction:type: CodeScanningAlerts)
and supports additional configuration options:
toolName [optional]
The name of a code scanning tool. If specified, only results by this tool will be collected.
Example: ‘CodeQL’.
state [optional]
If specified, only code scanning alerts with this state will be returned.
Can be one of: ‘open’, ‘closed’, ‘dismissed’, ‘fixed’.
severity [optional]
If specified, only code scanning alerts with this severity will be returned.
Can be one of: ‘critical’, ‘high’, ‘medium’, ‘low’, ‘warning’, ‘note’, ‘error’.
The following is an example of the CodeScanningAlerts Fact Collector configuration:
Shape of A CodeScanningAlerts Fact
The shape of aCodeScanningAlerts Fact is based on the Fact Schema.
For a description of the data collected regarding code scanning alerts, refer to the GitHub API documentation.
The following is an example of the collected CodeScanningAlerts fact:
Shape of A CodeScanningAlerts Fact Check
The shape of aCodeScanningAlerts Fact Check matches the Shape of a Fact Check.
The following is an example of the CodeScanningAlerts fact checks:
Collecting DependabotAlerts Fact
TheDependabotAlerts fact contains information about dependabot alerts for a GitHub repository.
Prerequisites:
- In order to be able to collect dependabot alerts you must enable them in GitHub, refer to the GitHub Dependabot documentation.
- Grant your GitHub app or access token with necessary permissions listed in the List Dependabot alerts for a repository GitHub API documentation.
This is a sensitive fact. See docsfor more
details.
Shape of A DependabotAlerts Fact Collector
The shape of a DependabotAlerts Fact Collector matches the Overall Shape Of A Fact Collector (restriction:type: DependabotAlerts)
and supports additional configuration options:
states [optional]
If specified, only dependabot alerts with these states will be returned.
Possible values: ‘auto_dismissed’, ‘dismissed’, ‘fixed’, ‘open’.
severities [optional]
If specified, only dependabot alerts with these severities will be returned.
Possible values: ‘low’, ‘medium’, ‘high’, ‘critical’.
The following is an example of the DependabotAlerts Fact Collector configuration:
Shape of A DependabotAlerts Fact
The shape of aDependabotAlerts Fact is based on the Fact Schema.
For a description of the data collected regarding dependabot alerts, refer to the GitHub API documentation.
The following is an example of the collected DependabotAlerts fact:
Shape of A DependabotAlerts Fact Check
The shape of aDependabotAlerts Fact Check matches the Shape of a Fact Check.
The following is an example of the DependabotAlerts fact checks:
Collecting RepositoryDetails Fact
TheRepositoryDetails fact contains information about a GitHub repository.
Prerequisites:
- Grant your GitHub app or access token with necessary permissions listed in the Get a repository GitHub API documentation.
Shape of A RepositoryDetails Fact Collector
The shape of aRepositoryDetails Fact Collector matches the Overall Shape Of A Fact Collector (restriction: type: RepositoryDetails).
The following is an example of the RepositoryDetails Fact Collector configuration:
Shape of A RepositoryDetails Fact
The shape of aRepositoryDetails Fact is based on the Fact Schema.
For a description of the data collected about repository, refer to the GitHub API documentation.
The following is an example of the collected RepositoryDetails fact:
Shape of A RepositoryDetails Fact Check
The shape of aRepositoryDetails Fact Check matches the Shape of a Fact Check.
The following is an example of the RepositoryDetails fact checks:
Collecting RepositoryLanguages Fact
TheRepositoryLanguages fact contains information about languages used in a GitHub repository.
Prerequisites:
- Grant your GitHub app or access token with necessary permissions listed in the List repository languages GitHub API documentation.
Shape of A RepositoryLanguages Fact Collector
The shape of aRepositoryLanguages Fact Collector matches the Overall Shape Of A Fact Collector (restriction: type: RepositoryLanguages).
The following is an example of the RepositoryLanguages Fact Collector configuration:
Shape of A RepositoryLanguages Fact
The shape of aRepositoryLanguages Fact is based on the Fact Schema.
For a description of the data collected about repository languages, refer to the GitHub API documentation.
The following is an example of the collected RepositoryLanguages fact:
Shape of A RepositoryLanguages Fact Check
The shape of aRepositoryLanguages Fact Check matches the Shape of a Fact Check.
The following is an example of the RepositoryLanguages fact checks:
Collecting SecretScanningAlerts Fact
TheSecretScanningAlerts fact contains information about secret scanning alerts for a GitHub repository.
Prerequisites:
- In order to be able to collect secret scanning alerts you must enable them in GitHub, refer to the GitHub Secret Scanning documentation.
- Grant your GitHub app or access token with necessary permissions listed in the List secret scanning alerts for a repository GitHub API documentation.
This is a sensitive fact. See docsfor more
details.
Shape of A SecretScanningAlerts Fact Collector
The shape of a CodeScanningAlerts Fact Collector matches the Overall Shape Of A Fact Collector (restriction:type: SecretScanningAlerts)
and supports additional configuration options:
state [optional]
If specified, only secret scanning alerts with this state will be returned.
Can be one of: ‘open’, ‘resolved’.
validities [optional]
If specified, only code scanning alerts with these validities will be returned.
Possible values: ‘active’, ‘inactive’, ‘unknown’.
The following is an example of the SecretScanningAlerts Fact Collector configuration:
Shape of A SecretScanningAlerts Fact
The shape of aSecretScanningAlerts Fact is based on the Fact Schema.
For a description of the data collected regarding secret scanning alerts, refer to the GitHub API documentation.
The following is an example of the collected SecretScanningAlerts fact:
Shape of A SecretScanningAlerts Fact Check
The shape of aSecretScanningAlerts Fact Check matches the Shape of a Fact Check.
The following is an example of the SecretScanningAlerts fact checks:
Collecting SecurityAdvisories Fact
TheSecurityAdvisories fact contains information about security advisories in a GitHub repository.
Prerequisites:
- Grant your GitHub app or access token with necessary permissions listed in the List repository security advisories GitHub API documentation.
Shape of A SecurityAdvisories Fact Collector
The shape of a SecurityAdvisories Fact Collector matches the Overall Shape Of A Fact Collector (restriction:type: SecurityAdvisories)
and supports additional configuration options:
state [optional]
If specified, only security advisories with this state will be returned.
Can be one of: ‘triage’, ‘draft’, ‘published’, ‘closed’.
The following is an example of the SecurityAdvisories Fact Collector configuration:
Shape of A SecurityAdvisories Fact
The shape of aSecurityAdvisories Fact is based on the Fact Schema.
For a description of the data collected regarding security advisories, refer to the GitHub API documentation.
The following is an example of the collected SecurityAdvisories fact:
Shape of A SecurityAdvisories Fact Check
The shape of aSecurityAdvisories Fact Check matches the Shape of a Fact Check.
The following is an example of the SecurityAdvisories fact checks:
Appendix
Recommended GitHub Settings Fact Collector
Pre-builtRecommended GitHub Settings checks are based on the following collector configuration: