Skip to content
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.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
404 changes: 222 additions & 182 deletions README.md

Large diffs are not rendered by default.

527 changes: 527 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"dependencies": {
"@stackql/pgwire-lite": "^1.0.1",
"@stackql/provider-utils": "^0.4.6"
"@stackql/provider-utils": "^0.5.0"
},
"keywords": [
"stackql",
Expand Down
Empty file removed website/docs/.gitkeep
Empty file.
117 changes: 117 additions & 0 deletions website/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
title: github
hide_title: false
hide_table_of_contents: false
keywords:
- github
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage GitHub resources using SQL
custom_edit_url: null
image: /img/stackql-github-provider-featured-image.png
id: 'provider-intro'
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';

Web-based version-control and collaboration.

:::info Provider Summary (v24.04.00227)

<div class="row">
<div class="providerDocColumn">
<span>total services:&nbsp;<b>31</b></span><br />
<span>total methods:&nbsp;<b>885</b></span><br />
</div>
<div class="providerDocColumn">
<span>total resources:&nbsp;<b>281</b></span><br />
<span>total selectable resources:&nbsp;<b>276</b></span><br />
</div>
</div>

:::

See also:
[[` SHOW `]](https://stackql.io/docs/language-spec/show) [[` DESCRIBE `]](https://stackql.io/docs/language-spec/describe) [[` REGISTRY `]](https://stackql.io/docs/language-spec/registry)
* * *

## Installation

To pull the latest version of the `github` provider, run the following command:

```bash
REGISTRY PULL github;
```
> To view previous provider versions or to pull a specific provider version, see [here](https://stackql.io/docs/language-spec/registry).

## Authentication

The following system environment variables are used for authentication by default:

- <CopyableCode code="STACKQL_GITHUB_USERNAME" /> - GitHub username (login)
- <CopyableCode code="STACKQL_GITHUB_PASSWORD" /> - GitHub Personal Access Token (see <a href="https://docs.github.com/en/enterprise-server@3.4/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token">Creating a personal access token</a>)

These variables are sourced at runtime (from the local machine or as CI variables/secrets).

<details>

<summary>Using different environment variables</summary>

To use different environment variables (instead of the defaults), use the `--auth` flag of the `stackql` program. For example:

```bash

AUTH='{ "github": { "type": "basic", "username_var": "YOUR_GITHUB_USERNAME_VAR", "password_var": "YOUR_GITHUB_PASSWORD_VAR" }}'
stackql shell --auth="${AUTH}"

```
or using PowerShell:

```powershell

$Auth = "{ 'github': { 'type': 'basic', 'username_var': 'YOUR_GITHUB_USERNAME_VAR', 'password_var': 'YOUR_GITHUB_PASSWORD_VAR' }}"
stackql.exe shell --auth=$Auth

```
</details>

## Services
<div class="row">
<div class="providerDocColumn">
<a href="/services/actions/">actions</a><br />
<a href="/services/activity/">activity</a><br />
<a href="/services/apps/">apps</a><br />
<a href="/services/billing/">billing</a><br />
<a href="/services/checks/">checks</a><br />
<a href="/services/code_scanning/">code_scanning</a><br />
<a href="/services/codes_of_conduct/">codes_of_conduct</a><br />
<a href="/services/codespaces/">codespaces</a><br />
<a href="/services/copilot/">copilot</a><br />
<a href="/services/dependabot/">dependabot</a><br />
<a href="/services/dependency_graph/">dependency_graph</a><br />
<a href="/services/gists/">gists</a><br />
<a href="/services/git/">git</a><br />
<a href="/services/gitignore/">gitignore</a><br />
<a href="/services/interactions/">interactions</a><br />
<a href="/services/issues/">issues</a><br />
</div>
<div class="providerDocColumn">
<a href="/services/licenses/">licenses</a><br />
<a href="/services/migrations/">migrations</a><br />
<a href="/services/oidc/">oidc</a><br />
<a href="/services/orgs/">orgs</a><br />
<a href="/services/packages/">packages</a><br />
<a href="/services/projects/">projects</a><br />
<a href="/services/pulls/">pulls</a><br />
<a href="/services/rate_limit/">rate_limit</a><br />
<a href="/services/reactions/">reactions</a><br />
<a href="/services/repos/">repos</a><br />
<a href="/services/search/">search</a><br />
<a href="/services/secret_scanning/">secret_scanning</a><br />
<a href="/services/security_advisories/">security_advisories</a><br />
<a href="/services/teams/">teams</a><br />
<a href="/services/users/">users</a><br />
</div>
</div>
42 changes: 42 additions & 0 deletions website/docs/services/actions/allowed_actions/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: allowed_actions
hide_title: false
hide_table_of_contents: false
keywords:
- allowed_actions
- actions
- github
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage GitHub resources using SQL
custom_edit_url: null
image: /img/stackql-github-provider-featured-image.png
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';




## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>allowed_actions</code></td></tr>
<tr><td><b>Type</b></td><td>Resource</td></tr>
<tr><td><b>Id</b></td><td><CopyableCode code="github.actions.allowed_actions" /></td></tr>
</tbody></table>

## Fields
| Name | Datatype | Description |
|:-----|:---------|:------------|
| <CopyableCode code="github_owned_allowed" /> | `boolean` | Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. |
| <CopyableCode code="patterns_allowed" /> | `array` | Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`.<br /><br />**Note**: The `patterns_allowed` setting only applies to public repositories. |
| <CopyableCode code="verified_allowed" /> | `boolean` | Whether actions from GitHub Marketplace verified creators are allowed. Set to `true` to allow all actions by GitHub Marketplace verified creators. |
## Methods
| Name | Accessible by | Required Params | Description |
|:-----|:--------------|:----------------|:------------|
| <CopyableCode code="get_allowed_actions_organization" /> | `SELECT` | <CopyableCode code="org" /> | Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).""<br /><br />You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. |
| <CopyableCode code="get_allowed_actions_repository" /> | `SELECT` | <CopyableCode code="owner, repo" /> | Gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."<br /><br />You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. |
| <CopyableCode code="set_allowed_actions_organization" /> | `EXEC` | <CopyableCode code="org" /> | Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."<br /><br />You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. |
| <CopyableCode code="set_allowed_actions_repository" /> | `EXEC` | <CopyableCode code="owner, repo" /> | Sets the actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."<br /><br />You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. |
51 changes: 51 additions & 0 deletions website/docs/services/actions/artifacts/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: artifacts
hide_title: false
hide_table_of_contents: false
keywords:
- artifacts
- actions
- github
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage GitHub resources using SQL
custom_edit_url: null
image: /img/stackql-github-provider-featured-image.png
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';




## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>artifacts</code></td></tr>
<tr><td><b>Type</b></td><td>Resource</td></tr>
<tr><td><b>Id</b></td><td><CopyableCode code="github.actions.artifacts" /></td></tr>
</tbody></table>

## Fields
| Name | Datatype | Description |
|:-----|:---------|:------------|
| <CopyableCode code="id" /> | `integer` | |
| <CopyableCode code="name" /> | `string` | The name of the artifact. |
| <CopyableCode code="archive_download_url" /> | `string` | |
| <CopyableCode code="created_at" /> | `string` | |
| <CopyableCode code="expired" /> | `boolean` | Whether or not the artifact has expired. |
| <CopyableCode code="expires_at" /> | `string` | |
| <CopyableCode code="node_id" /> | `string` | |
| <CopyableCode code="size_in_bytes" /> | `integer` | The size in bytes of the artifact. |
| <CopyableCode code="updated_at" /> | `string` | |
| <CopyableCode code="url" /> | `string` | |
| <CopyableCode code="workflow_run" /> | `object` | |
## Methods
| Name | Accessible by | Required Params | Description |
|:-----|:--------------|:----------------|:------------|
| <CopyableCode code="get_artifact" /> | `SELECT` | <CopyableCode code="artifact_id, owner, repo" /> | Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. |
| <CopyableCode code="list_artifacts_for_repo" /> | `SELECT` | <CopyableCode code="owner, repo" /> | Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. |
| <CopyableCode code="list_workflow_run_artifacts" /> | `SELECT` | <CopyableCode code="owner, repo, run_id" /> | Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. |
| <CopyableCode code="delete_artifact" /> | `DELETE` | <CopyableCode code="artifact_id, owner, repo" /> | Deletes an artifact for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. |
| <CopyableCode code="download_artifact" /> | `EXEC` | <CopyableCode code="archive_format, artifact_id, owner, repo" /> | Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in<br />the response header to find the URL for the download. The `:archive_format` must be `zip`.<br /><br />You must authenticate using an access token with the `repo` scope to use this endpoint.<br />GitHub Apps must have the `actions:read` permission to use this endpoint. |
40 changes: 40 additions & 0 deletions website/docs/services/actions/cache/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: cache
hide_title: false
hide_table_of_contents: false
keywords:
- cache
- actions
- github
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage GitHub resources using SQL
custom_edit_url: null
image: /img/stackql-github-provider-featured-image.png
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';




## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>cache</code></td></tr>
<tr><td><b>Type</b></td><td>Resource</td></tr>
<tr><td><b>Id</b></td><td><CopyableCode code="github.actions.cache" /></td></tr>
</tbody></table>

## Fields
| Name | Datatype | Description |
|:-----|:---------|:------------|
| <CopyableCode code="actions_caches" /> | `array` | Array of caches |
| <CopyableCode code="total_count" /> | `integer` | Total number of caches |
## Methods
| Name | Accessible by | Required Params | Description |
|:-----|:--------------|:----------------|:------------|
| <CopyableCode code="get_actions_cache_list" /> | `SELECT` | <CopyableCode code="owner, repo" /> | Lists the GitHub Actions caches for a repository.<br />You must authenticate using an access token with the `repo` scope to use this endpoint.<br />GitHub Apps must have the `actions:read` permission to use this endpoint. |
| <CopyableCode code="delete_actions_cache_by_id" /> | `DELETE` | <CopyableCode code="cache_id, owner, repo" /> | Deletes a GitHub Actions cache for a repository, using a cache ID.<br /><br />You must authenticate using an access token with the `repo` scope to use this endpoint.<br /><br />GitHub Apps must have the `actions:write` permission to use this endpoint. |
| <CopyableCode code="delete_actions_cache_by_key" /> | `DELETE` | <CopyableCode code="key, owner, repo" /> | Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref.<br /><br />You must authenticate using an access token with the `repo` scope to use this endpoint.<br /><br />GitHub Apps must have the `actions:write` permission to use this endpoint. |
40 changes: 40 additions & 0 deletions website/docs/services/actions/cache_usage/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: cache_usage
hide_title: false
hide_table_of_contents: false
keywords:
- cache_usage
- actions
- github
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage GitHub resources using SQL
custom_edit_url: null
image: /img/stackql-github-provider-featured-image.png
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';




## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>cache_usage</code></td></tr>
<tr><td><b>Type</b></td><td>Resource</td></tr>
<tr><td><b>Id</b></td><td><CopyableCode code="github.actions.cache_usage" /></td></tr>
</tbody></table>

## Fields
| Name | Datatype | Description |
|:-----|:---------|:------------|
| <CopyableCode code="active_caches_count" /> | `integer` | The number of active caches in the repository. |
| <CopyableCode code="active_caches_size_in_bytes" /> | `integer` | The sum of the size in bytes of all the active cache items in the repository. |
| <CopyableCode code="full_name" /> | `string` | The repository owner and name for the cache usage being shown. |
## Methods
| Name | Accessible by | Required Params | Description |
|:-----|:--------------|:----------------|:------------|
| <CopyableCode code="get_actions_cache_usage" /> | `SELECT` | <CopyableCode code="owner, repo" /> | Gets GitHub Actions cache usage for a repository.<br />The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.<br />Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. |
| <CopyableCode code="get_actions_cache_usage_for_org" /> | `SELECT` | <CopyableCode code="org" /> | Gets the total GitHub Actions cache usage for an organization.<br />The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.<br />You must authenticate using an access token with the `read:org` scope to use this endpoint. GitHub Apps must have the `organization_admistration:read` permission to use this endpoint. |
Loading
Loading