Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tables github_repository_dependabot_alert and github_organization_dependabot_alert #215

Merged
merged 3 commits into from Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 52 additions & 0 deletions docs/tables/github_organization_dependabot_alert.md
@@ -0,0 +1,52 @@
# Table: github_organization_dependabot_alert

The `github_organization_dependabot_alert` table can be used to query information about dependabot alerts from an organization. You must be an owner or security manager for the organization to successfully query dependabot alerts.

**You must specify the organization** in the where or join clause (`where organization=`, `join github_organization_depedanbot_alert on organization=`).

## Examples

### List dependabot alerts

```sql
select
organization,
state,
dependency_package_ecosystem,
dependency_package_name
from
github_organization_dependabot_alert
where
organization = 'my_org';
```

### List open dependabot alerts

```sql
select
organization,
state,
dependency_package_ecosystem,
dependency_package_name
from
github_organization_dependabot_alert
where
organization = 'my_org'
and state = 'open';
```

### List open critical dependabot alerts

```sql
select
organization,
state,
dependency_package_ecosystem,
dependency_package_name
from
github_organization_dependabot_alert
where
organization = 'my_org'
and state = 'open'
and security_advisory_severity = 'critical';
```
49 changes: 49 additions & 0 deletions docs/tables/github_repository_dependabot_alert.md
@@ -0,0 +1,49 @@
# Table: github_repository_dependabot_alert

The `github_repository_dependabot_alert` table can be used to query information about dependabot alerts from a repository.

**You must specify which repository** in the where or join clause using the `repository_full_name` column.

## Examples

### List dependabot alerts

```sql
select
state,
dependency_package_ecosystem,
dependency_package_name
from
github_repository_dependabot_alert
where
repository_full_name = 'turbot/steampipe';
```

### List open dependabot alerts

```sql
select
state,
dependency_package_ecosystem,
dependency_package_name
from
github_repository_dependabot_alert
where
repository_full_name = 'turbot/steampipe'
and state = 'open';
```

### List open critical dependabot alerts

```sql
select
state,
dependency_package_ecosystem,
dependency_package_name
from
github_repository_dependabot_alert
where
repository_full_name = 'turbot/steampipe'
and state = 'open'
and security_advisory_severity = 'critical';
```
2 changes: 2 additions & 0 deletions github/plugin.go
Expand Up @@ -39,10 +39,12 @@ func Plugin(ctx context.Context) *plugin.Plugin {
"github_my_team": tableGitHubMyTeam(),
"github_organization": tableGitHubOrganization(),
"github_organization_member": tableGitHubOrganizationMember(),
"github_organization_dependabot_alert": tableGitHubOrganizationDependabotAlert(),
"github_pull_request": tableGitHubPullRequest(),
"github_rate_limit": tableGitHubRateLimit(ctx),
"github_release": tableGitHubRelease(ctx),
"github_repository": tableGitHubRepository(),
"github_repository_dependabot_alert": tableGitHubRepositoryDependabotAlert(),
"github_search_code": tableGitHubSearchCode(ctx),
"github_search_commit": tableGitHubSearchCommit(ctx),
"github_search_issue": tableGitHubSearchIssue(ctx),
Expand Down