github
Module github
API
Definitions
ballerinax/github Ballerina library
Overview
GitHub is a widely used platform for version control and collaboration, allowing developers to work together on projects from anywhere. It hosts a vast array of both open-source and private projects, providing a suite of development tools for collaborative software development.
This Ballerina connector is designed to interface with GitHub's REST API (version 2022-11-28), facilitating programmatic access to GitHub's services. It enables developers to automate tasks, manage repositories, issues, pull requests, and more, directly from Ballerina applications.
Setup guide
To use the GitHub Connector in Ballerina, you must have a GitHub account and a Personal Access Token (PAT) for authentication. If you already have a GitHub account, you can integrate the connector with your existing account. If not, you can create a new GitHub account by visiting GitHub's Sign Up page and following the registration process. Once you have a GitHub account, you can proceed to create a PAT.
Step 1: Access GitHub Settings
- Once logged in, click on the profile picture in the top-right corner of the page.
- Select Settings from the dropdown menu.
Step 2: Navigate to Developer Settings
- Scroll down in the sidebar on the left side of the settings page.
- click on Developer settings located near the bottom.
Step 3: Go to Personal Access Tokens
-
Inside Developer Settings find and click on Personal access tokens.
Step 4: Generate a New Token
- Click on the Generate new token button (you might be asked to enter you password again for security purposes).
Step 5: Configure & Generate the Token
-
Note: Give your token a descriptive name so you can remember it's purpose
-
Expiration: Select the duration before the token expires (e.g., 30 days, 60 days, 90 days, custom, or no expiration).
-
Select Scopes: Scopes control access for the token. Choose what you need the token for (e.g., repo access, user data access). For typical repository operations, selecting
repo
is often sufficient.
Quickstart
To use the GitHub
connector in your Ballerina application, modify the .bal
file as follows:
Step 1: Import the connector
Import the ballerinax/github
package into your Ballerina project.
import ballerinax/github;
Step 2: Instantiate a new connector
Create a github:ConnectionConfig
with the obtained PAT and initialize the connector with it.
github:ConnectionConfig gitHubConfig = { auth: { token: authToken } }; github:Client github = check new (gitHubConfig);
Step 3: Invoke the connector operation
Now, utilize the available connector operations.
Get Private Repositories of Authenticated User
github:Repository[] userRepos = check github->/user/repos(visibility = "private", 'type = ());
Create a Private Repository
github:User_repos_body body = { name: "New Test Repo Name", 'private: true, description: "New Test Repo Description" }; github:Repository createdRepo = check github->/user/repos.post(body);
Examples
The GitHub
connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering use cases like initializing a new project, creating issues, and managing pull requests.
-
Initialize a New GitHub Project - Create a new repository on GitHub, initialize it with a README file, and add collaborators to the repository.
-
Create and Assign an Issue in GitHub - Create a new issue on GitHub, assign it to a specific user, and add labels.
-
Create and Manage a PullRequest in GitHub - Create a pull request on GitHub, and request changes as necessary.
-
Star Ballerina-Platform Repositories - Fetch all repositories under the
ballerina-platform
organization on GitHub and star each of them
Clients
github: Client
GitHub's v3 REST API.
Constructor
Gets invoked to initialize the connector
.
init (ConnectionConfig config, string serviceUrl)
- config ConnectionConfig - The configurations to be used when initializing the
connector
- serviceUrl string "https://api.github.com" - URL of the target service
get .
GitHub API Root
get advisories
function get advisories(string? ghsa_id, "reviewed"|"malware"|"unreviewed" 'type, string? cve_id, "actions"|"composer"|"erlang"|"go"|"maven"|"npm"|"nuget"|"other"|"pip"|"pub"|"rubygems"|"rust"? ecosystem, "unknown"|"low"|"medium"|"high"|"critical"? severity, Cwes? cwes, boolean? is_withdrawn, Affects? affects, string? published, string? updated, string? modified, string? before, string? after, "asc"|"desc" direction, int per_page, "updated"|"published" sort) returns GlobalAdvisory[]|error
List global security advisories
Parameters
- ghsa_id string? (default ()) - If specified, only advisories with this GHSA (GitHub Security Advisory) identifier will be returned.
- 'type "reviewed"|"malware"|"unreviewed" (default "reviewed") - If specified, only advisories of this type will be returned. By default, a request with no other parameters defined will only return reviewed advisories that are not malware.
- cve_id string? (default ()) - If specified, only advisories with this CVE (Common Vulnerabilities and Exposures) identifier will be returned.
- ecosystem "actions"|"composer"|"erlang"|"go"|"maven"|"npm"|"nuget"|"other"|"pip"|"pub"|"rubygems"|"rust"? (default ()) - If specified, only advisories for these ecosystems will be returned.
- severity "unknown"|"low"|"medium"|"high"|"critical"? (default ()) - If specified, only advisories with these severities will be returned.
- cwes Cwes? (default ()) - If specified, only advisories with these Common Weakness Enumerations (CWEs) will be returned.
Example:
cwes=79,284,22
orcwes[]=79&cwes[]=284&cwes[]=22
- is_withdrawn boolean? (default ()) - Whether to only return advisories that have been withdrawn.
- affects Affects? (default ()) - If specified, only return advisories that affect any of
package
orpackage@version
. A maximum of 1000 packages can be specified. If the query parameter causes the URL to exceed the maximum URL length supported by your client, you must specify fewer packages. Example:affects=package1,package2@1.0.0,package3@^2.0.0
oraffects[]=package1&affects[]=package2@1.0.0
- published string? (default ()) - If specified, only return advisories that were published on a date or date range. For more information on the syntax of the date range, see "Understanding the search syntax."
- updated string? (default ()) - If specified, only return advisories that were updated on a date or date range. For more information on the syntax of the date range, see "Understanding the search syntax."
- modified string? (default ()) - If specified, only show advisories that were updated or published on a date or date range. For more information on the syntax of the date range, see "Understanding the search syntax."
- before string? (default ()) - A cursor, as given in the Link header. If specified, the query only searches for results before this cursor.
- after string? (default ()) - A cursor, as given in the Link header. If specified, the query only searches for results after this cursor.
- direction "asc"|"desc" (default "desc") - The direction to sort the results by.
- per_page int (default 30) - The number of results per page (max 100).
- sort "updated"|"published" (default "published") - The property to sort the results by.
Return Type
- GlobalAdvisory[]|error - Response
get advisories/[string ghsa_id]
function get advisories/[string ghsa_id]() returns GlobalAdvisory|error
Get a global security advisory
Return Type
- GlobalAdvisory|error - Response
get app
function get app() returns Integration|error
Get the authenticated app
Return Type
- Integration|error - Response
post app-manifests/[string code]/conversions
function post app\-manifests/[string code]/conversions() returns ManifestConversions|error
Create a GitHub App from a manifest
Return Type
- ManifestConversions|error - Response
get app/hook/config
function get app/hook/config() returns WebhookConfig|error
Get a webhook configuration for an app
Return Type
- WebhookConfig|error - Response
patch app/hook/config
function patch app/hook/config(Hook_config_body payload) returns WebhookConfig|error
Update a webhook configuration for an app
Parameters
- payload Hook_config_body -
Return Type
- WebhookConfig|error - Response
get app/hook/deliveries
function get app/hook/deliveries(int per_page, string? cursor, boolean? redelivery) returns HookDeliveryItem[]|error
List deliveries for an app webhook
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- cursor string? (default ()) - Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the
link
header for the next and previous page cursors.
- redelivery boolean? (default ()) -
Return Type
- HookDeliveryItem[]|error - Response
get app/hook/deliveries/[int delivery_id]
function get app/hook/deliveries/[int delivery_id]() returns HookDelivery|error
Get a delivery for an app webhook
Return Type
- HookDelivery|error - Response
post app/hook/deliveries/[int delivery_id]/attempts
function post app/hook/deliveries/[int delivery_id]/attempts() returns json|error
Redeliver a delivery for an app webhook
Return Type
- json|error - Accepted
get app/installation-requests
function get app/installation\-requests(int per_page, int page) returns IntegrationInstallationRequest[]|error
List installation requests for the authenticated app
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- IntegrationInstallationRequest[]|error - List of integration installation requests
get app/installations
function get app/installations(int per_page, int page, string? since, string? outdated) returns Installation[]|error
List installations for the authenticated app
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
- outdated string? (default ()) -
Return Type
- Installation[]|error - The permissions the installation has are included under the
permissions
key.
get app/installations/[int installation_id]
function get app/installations/[int installation_id]() returns Installation|error
Get an installation for the authenticated app
Return Type
- Installation|error - Response
delete app/installations/[int installation_id]
Delete an installation for the authenticated app
post app/installations/[int installation_id]/access_tokens
function post app/installations/[int installation_id]/access_tokens(Installation_id_access_tokens_body payload) returns InstallationToken|error
Create an installation access token for an app
Parameters
- payload Installation_id_access_tokens_body -
Return Type
- InstallationToken|error - Response
put app/installations/[int installation_id]/suspended
Suspend an app installation
delete app/installations/[int installation_id]/suspended
Unsuspend an app installation
delete applications/[string client_id]/grant
function delete applications/[string client_id]/grant(Client_id_grant_body payload) returns Response|error
Delete an app authorization
Parameters
- payload Client_id_grant_body -
post applications/[string client_id]/token
function post applications/[string client_id]/token(Client_id_token_body payload) returns Authorization|error
Check a token
Parameters
- payload Client_id_token_body -
Return Type
- Authorization|error - Response
delete applications/[string client_id]/token
function delete applications/[string client_id]/token(Client_id_token_body_1 payload) returns Response|error
Delete an app token
Parameters
- payload Client_id_token_body_1 -
patch applications/[string client_id]/token
function patch applications/[string client_id]/token(Client_id_token_body_2 payload) returns Authorization|error
Reset a token
Parameters
- payload Client_id_token_body_2 -
Return Type
- Authorization|error - Response
post applications/[string client_id]/token/scoped
function post applications/[string client_id]/token/scoped(Token_scoped_body payload) returns Authorization|error
Create a scoped access token
Parameters
- payload Token_scoped_body -
Return Type
- Authorization|error - Response
get apps/[string app_slug]
function get apps/[string app_slug]() returns Integration|error
Get an app
Return Type
- Integration|error - Response
get assignments/[int assignment_id]
function get assignments/[int assignment_id]() returns ClassroomAssignment|error
Get an assignment
Return Type
- ClassroomAssignment|error - Response
get assignments/[int assignment_id]/accepted_assignments
function get assignments/[int assignment_id]/accepted_assignments(int page, int per_page) returns ClassroomAcceptedAssignment[]|error
List accepted assignments for an assignment
Parameters
- page int (default 1) - Page number of the results to fetch.
- per_page int (default 30) - The number of results per page (max 100).
Return Type
- ClassroomAcceptedAssignment[]|error - Response
get assignments/[int assignment_id]/grades
function get assignments/[int assignment_id]/grades() returns ClassroomAssignmentGrade[]|error
Get assignment grades
Return Type
- ClassroomAssignmentGrade[]|error - Response
get classrooms
function get classrooms(int page, int per_page) returns SimpleClassroom[]|error
List classrooms
Parameters
- page int (default 1) - Page number of the results to fetch.
- per_page int (default 30) - The number of results per page (max 100).
Return Type
- SimpleClassroom[]|error - Response
get classrooms/[int classroom_id]
Get a classroom
get classrooms/[int classroom_id]/assignments
function get classrooms/[int classroom_id]/assignments(int page, int per_page) returns SimpleClassroomAssignment[]|error
List assignments for a classroom
Parameters
- page int (default 1) - Page number of the results to fetch.
- per_page int (default 30) - The number of results per page (max 100).
Return Type
- SimpleClassroomAssignment[]|error - Response
get codes_of_conduct
function get codes_of_conduct() returns CodeOfConduct[]|error?
Get all codes of conduct
Return Type
- CodeOfConduct[]|error? - Response
get codes_of_conduct/[string 'key]
function get codes_of_conduct/[string 'key]() returns CodeOfConduct|error?
Get a code of conduct
Return Type
- CodeOfConduct|error? - Response
get emojis
function get emojis() returns json|error?
Get emojis
Return Type
- json|error? - Response
get enterprises/[string enterprise]/dependabot/alerts
function get enterprises/[string enterprise]/dependabot/alerts(string? state, string? severity, string? ecosystem, string? package, "development"|"runtime"? scope, "created"|"updated" sort, "asc"|"desc" direction, string? before, string? after, int first, int? last, int per_page) returns DependabotAlertWithRepository[]|error
List Dependabot alerts for an enterprise
Parameters
- state string? (default ()) - A comma-separated list of states. If specified, only alerts with these states will be returned.
Can be:
auto_dismissed
,dismissed
,fixed
,open
- severity string? (default ()) - A comma-separated list of severities. If specified, only alerts with these severities will be returned.
Can be:
low
,medium
,high
,critical
- ecosystem string? (default ()) - A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned.
Can be:
composer
,go
,maven
,npm
,nuget
,pip
,pub
,rubygems
,rust
- package string? (default ()) - A comma-separated list of package names. If specified, only alerts for these packages will be returned.
- scope "development"|"runtime"? (default ()) - The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned.
- sort "created"|"updated" (default "created") - The property by which to sort the results.
created
means when the alert was created.updated
means when the alert's state last changed.
- direction "asc"|"desc" (default "desc") - The direction to sort the results by.
- before string? (default ()) - A cursor, as given in the Link header. If specified, the query only searches for results before this cursor.
- after string? (default ()) - A cursor, as given in the Link header. If specified, the query only searches for results after this cursor.
- first int (default 30) - Deprecated. The number of results per page (max 100), starting from the first matching result.
This parameter must not be used in combination with
last
. Instead, useper_page
in combination withafter
to fetch the first page of results.
- last int? (default ()) - Deprecated. The number of results per page (max 100), starting from the last matching result.
This parameter must not be used in combination with
first
. Instead, useper_page
in combination withbefore
to fetch the last page of results.
- per_page int (default 30) - The number of results per page (max 100).
Return Type
- DependabotAlertWithRepository[]|error - Response
get enterprises/[string enterprise]/secret-scanning/alerts
function get enterprises/[string enterprise]/secret\-scanning/alerts("open"|"resolved"? state, string? secret_type, string? resolution, "created"|"updated" sort, "asc"|"desc" direction, int per_page, string? before, string? after) returns OrganizationSecretScanningAlert[]|error
List secret scanning alerts for an enterprise
Parameters
- state "open"|"resolved"? (default ()) - Set to
open
orresolved
to only list secret scanning alerts in a specific state.
- secret_type string? (default ()) - A comma-separated list of secret types to return. By default all secret types are returned. See "Secret scanning patterns" for a complete list of secret types.
- resolution string? (default ()) - A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions are
false_positive
,wont_fix
,revoked
,pattern_edited
,pattern_deleted
orused_in_tests
.
- sort "created"|"updated" (default "created") - The property to sort the results by.
created
means when the alert was created.updated
means when the alert was updated or resolved.
- direction "asc"|"desc" (default "desc") - The direction to sort the results by.
- per_page int (default 30) - The number of results per page (max 100).
- before string? (default ()) - A cursor, as given in the Link header. If specified, the query only searches for results before this cursor.
- after string? (default ()) - A cursor, as given in the Link header. If specified, the query only searches for results after this cursor.
Return Type
- OrganizationSecretScanningAlert[]|error - Response
get events
List public events
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
get feeds
Get feeds
get gists
List gists for the authenticated user
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
post gists
function post gists(Gists_body payload) returns GistSimple|error
Create a gist
Parameters
- payload Gists_body -
Return Type
- GistSimple|error - Response
get gists/'public
List public gists
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
get gists/starred
List starred gists
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
get gists/[string gist_id]
function get gists/[string gist_id]() returns GistSimple|error?
Get a gist
Return Type
- GistSimple|error? - Response
delete gists/[string gist_id]
Delete a gist
patch gists/[string gist_id]
function patch gists/[string gist_id](Gists_gist_id_body payload) returns GistSimple|error
Update a gist
Parameters
- payload Gists_gist_id_body -
Return Type
- GistSimple|error - Response
get gists/[string gist_id]/comments
function get gists/[string gist_id]/comments(int per_page, int page) returns GistComment[]|error
List gist comments
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- GistComment[]|error - Response
post gists/[string gist_id]/comments
function post gists/[string gist_id]/comments(Gist_id_comments_body payload) returns GistComment|error
Create a gist comment
Parameters
- payload Gist_id_comments_body -
Return Type
- GistComment|error - Response
get gists/[string gist_id]/comments/[int comment_id]
function get gists/[string gist_id]/comments/[int comment_id]() returns GistComment|error
Get a gist comment
Return Type
- GistComment|error - Response
delete gists/[string gist_id]/comments/[int comment_id]
Delete a gist comment
patch gists/[string gist_id]/comments/[int comment_id]
function patch gists/[string gist_id]/comments/[int comment_id](Comments_comment_id_body payload) returns GistComment|error
Update a gist comment
Parameters
- payload Comments_comment_id_body -
Return Type
- GistComment|error - Response
get gists/[string gist_id]/commits
function get gists/[string gist_id]/commits(int per_page, int page) returns GistCommit[]|error
List gist commits
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- GistCommit[]|error - Response
get gists/[string gist_id]/forks
function get gists/[string gist_id]/forks(int per_page, int page) returns GistSimple[]|error
List gist forks
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- GistSimple[]|error - Response
post gists/[string gist_id]/forks
Fork a gist
get gists/[string gist_id]/star
Check if a gist is starred
put gists/[string gist_id]/star
Star a gist
delete gists/[string gist_id]/star
Unstar a gist
get gists/[string gist_id]/[string sha]
function get gists/[string gist_id]/[string sha]() returns GistSimple|error
Get a gist revision
Return Type
- GistSimple|error - Response
get gitignore/templates
Get all gitignore templates
get gitignore/templates/[string name]
function get gitignore/templates/[string name]() returns GitignoreTemplate|error?
Get a gitignore template
Return Type
- GitignoreTemplate|error? - Response
get installation/repositories
function get installation/repositories(int per_page, int page) returns RepositoryResponse|error
List repositories accessible to the app installation
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- RepositoryResponse|error - Response
delete installation/token
function delete installation/token() returns error?
Revoke an installation access token
Return Type
- error? - Response
get issues
function get issues("assigned"|"created"|"mentioned"|"subscribed"|"repos"|"all" filter, "open"|"closed"|"all" state, string? labels, "created"|"updated"|"comments" sort, "asc"|"desc" direction, string? since, boolean? collab, boolean? orgs, boolean? owned, boolean? pulls, int per_page, int page) returns Issue[]|error
List issues assigned to the authenticated user
Parameters
- filter "assigned"|"created"|"mentioned"|"subscribed"|"repos"|"all" (default "assigned") - Indicates which sorts of issues to return.
assigned
means issues assigned to you.created
means issues created by you.mentioned
means issues mentioning you.subscribed
means issues you're subscribed to updates for.all
orrepos
means all issues you can see, regardless of participation or creation.
- state "open"|"closed"|"all" (default "open") - Indicates the state of the issues to return.
- labels string? (default ()) - A list of comma separated label names. Example:
bug,ui,@high
- sort "created"|"updated"|"comments" (default "created") - What to sort results by.
- direction "asc"|"desc" (default "desc") - The direction to sort the results by.
- collab boolean? (default ()) -
- orgs boolean? (default ()) -
- owned boolean? (default ()) -
- pulls boolean? (default ()) -
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
get licenses
function get licenses(boolean? featured, int per_page, int page) returns LicenseSimple[]|error?
Get all commonly used licenses
Parameters
- featured boolean? (default ()) -
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- LicenseSimple[]|error? - Response
get licenses/[string license]
Get a license
post markdown
function post markdown(Markdown_body payload) returns string|error?
Render a Markdown document
Parameters
- payload Markdown_body -
post markdown/raw
Render a Markdown document in raw mode
Parameters
- payload string -
get marketplace_listing/accounts/[int account_id]
function get marketplace_listing/accounts/[int account_id]() returns MarketplacePurchase|error
Get a subscription plan for an account
Return Type
- MarketplacePurchase|error - Response
get marketplace_listing/plans
function get marketplace_listing/plans(int per_page, int page) returns MarketplaceListingPlan[]|error
List plans
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- MarketplaceListingPlan[]|error - Response
get marketplace_listing/plans/[int plan_id]/accounts
function get marketplace_listing/plans/[int plan_id]/accounts("created"|"updated" sort, "asc"|"desc"? direction, int per_page, int page) returns MarketplacePurchase[]|error
List accounts for a plan
Parameters
- sort "created"|"updated" (default "created") - The property to sort the results by.
- direction "asc"|"desc"? (default ()) - To return the oldest accounts first, set to
asc
. Ignored without thesort
parameter.
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- MarketplacePurchase[]|error - Response
get marketplace_listing/stubbed/accounts/[int account_id]
function get marketplace_listing/stubbed/accounts/[int account_id]() returns MarketplacePurchase|error
Get a subscription plan for an account (stubbed)
Return Type
- MarketplacePurchase|error - Response
get marketplace_listing/stubbed/plans
function get marketplace_listing/stubbed/plans(int per_page, int page) returns MarketplaceListingPlan[]|error
List plans (stubbed)
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- MarketplaceListingPlan[]|error - Response
get marketplace_listing/stubbed/plans/[int plan_id]/accounts
function get marketplace_listing/stubbed/plans/[int plan_id]/accounts("created"|"updated" sort, "asc"|"desc"? direction, int per_page, int page) returns MarketplacePurchase[]|error
List accounts for a plan (stubbed)
Parameters
- sort "created"|"updated" (default "created") - The property to sort the results by.
- direction "asc"|"desc"? (default ()) - To return the oldest accounts first, set to
asc
. Ignored without thesort
parameter.
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- MarketplacePurchase[]|error - Response
get meta
function get meta() returns ApiOverview|error?
Get GitHub meta information
Return Type
- ApiOverview|error? - Response
get networks/[string owner]/[string repo]/events
function get networks/[string owner]/[string repo]/events(int per_page, int page) returns Event[]|error
List public events for a network of repositories
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
get notifications
function get notifications(boolean all, boolean participating, string? since, string? before, int page, int per_page) returns NotificationThread[]|error
List notifications for the authenticated user
Parameters
- all boolean (default false) - If
true
, show notifications marked as read.
- participating boolean (default false) - If
true
, only shows notifications in which the user is directly participating or mentioned.
- page int (default 1) - Page number of the results to fetch.
- per_page int (default 50) - The number of results per page (max 50).
Return Type
- NotificationThread[]|error - Response
put notifications
function put notifications(Notifications_body payload) returns NotificationRead|error
Mark notifications as read
Parameters
- payload Notifications_body -
Return Type
- NotificationRead|error - Response
get notifications/threads/[int thread_id]
function get notifications/threads/[int thread_id]() returns NotificationThread|error
Get a thread
Return Type
- NotificationThread|error - Response
patch notifications/threads/[int thread_id]
Mark a thread as read
get notifications/threads/[int thread_id]/subscription
function get notifications/threads/[int thread_id]/subscription() returns ThreadSubscription|error
Get a thread subscription for the authenticated user
Return Type
- ThreadSubscription|error - Response
put notifications/threads/[int thread_id]/subscription
function put notifications/threads/[int thread_id]/subscription(Thread_id_subscription_body payload) returns ThreadSubscription|error
Set a thread subscription
Parameters
- payload Thread_id_subscription_body -
Return Type
- ThreadSubscription|error - Response
delete notifications/threads/[int thread_id]/subscription
Delete a thread subscription
get octocat
Get Octocat
Parameters
- s string? (default ()) - The words to show in Octocat's speech bubble
get organizations
function get organizations(int? since, int per_page) returns OrganizationSimple[]|error?
List organizations
Parameters
- since int? (default ()) - An organization ID. Only return organizations with an ID greater than this ID.
- per_page int (default 30) - The number of results per page (max 100).
Return Type
- OrganizationSimple[]|error? - Response
get orgs/[string org]
function get orgs/[string org]() returns OrganizationFull|error
Get an organization
Return Type
- OrganizationFull|error - Response
delete orgs/[string org]
function delete orgs/[string org]() returns json|error
Delete an organization
Return Type
- json|error - Accepted
patch orgs/[string org]
function patch orgs/[string org](Orgs_org_body payload) returns OrganizationFull|error
Update an organization
Parameters
- payload Orgs_org_body -
Return Type
- OrganizationFull|error - Response
get orgs/[string org]/actions/cache/usage
function get orgs/[string org]/actions/cache/usage() returns ActionsCacheUsageOrgEnterprise|error
Get GitHub Actions cache usage for an organization
Return Type
- ActionsCacheUsageOrgEnterprise|error - Response
get orgs/[string org]/actions/cache/usage-by-repository
function get orgs/[string org]/actions/cache/usage\-by\-repository(int per_page, int page) returns ActionsCacheUsageByRepositoryResponse|error
List repositories with GitHub Actions cache usage for an organization
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- ActionsCacheUsageByRepositoryResponse|error - Response
get orgs/[string org]/actions/oidc/customization/sub
function get orgs/[string org]/actions/oidc/customization/sub() returns OidcCustomSub|error
Get the customization template for an OIDC subject claim for an organization
Return Type
- OidcCustomSub|error - A JSON serialized template for OIDC subject claim customization
put orgs/[string org]/actions/oidc/customization/sub
function put orgs/[string org]/actions/oidc/customization/sub(OidcCustomSub payload) returns EmptyObject|error
Set the customization template for an OIDC subject claim for an organization
Parameters
- payload OidcCustomSub -
Return Type
- EmptyObject|error - Empty response
get orgs/[string org]/actions/permissions
function get orgs/[string org]/actions/permissions() returns ActionsOrganizationPermissions|error
Get GitHub Actions permissions for an organization
Return Type
- ActionsOrganizationPermissions|error - Response
put orgs/[string org]/actions/permissions
function put orgs/[string org]/actions/permissions(Actions_permissions_body payload) returns error?
Set GitHub Actions permissions for an organization
Parameters
- payload Actions_permissions_body -
Return Type
- error? - Response
get orgs/[string org]/actions/permissions/repositories
function get orgs/[string org]/actions/permissions/repositories(int per_page, int page) returns RepositoryResponse|error
List selected repositories enabled for GitHub Actions in an organization
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- RepositoryResponse|error - Response
put orgs/[string org]/actions/permissions/repositories
function put orgs/[string org]/actions/permissions/repositories(Permissions_repositories_body payload) returns error?
Set selected repositories enabled for GitHub Actions in an organization
Parameters
- payload Permissions_repositories_body -
Return Type
- error? - Response
put orgs/[string org]/actions/permissions/repositories/[int repository_id]
function put orgs/[string org]/actions/permissions/repositories/[int repository_id]() returns error?
Enable a selected repository for GitHub Actions in an organization
Return Type
- error? - Response
delete orgs/[string org]/actions/permissions/repositories/[int repository_id]
function delete orgs/[string org]/actions/permissions/repositories/[int repository_id]() returns error?
Disable a selected repository for GitHub Actions in an organization
Return Type
- error? - Response
get orgs/[string org]/actions/permissions/selected-actions
function get orgs/[string org]/actions/permissions/selected\-actions() returns SelectedActions|error
Get allowed actions and reusable workflows for an organization
Return Type
- SelectedActions|error - Response
put orgs/[string org]/actions/permissions/selected-actions
function put orgs/[string org]/actions/permissions/selected\-actions(SelectedActions payload) returns error?
Set allowed actions and reusable workflows for an organization
Parameters
- payload SelectedActions -
Return Type
- error? - Response
get orgs/[string org]/actions/permissions/workflow
function get orgs/[string org]/actions/permissions/workflow() returns ActionsGetDefaultWorkflowPermissions|error
Get default workflow permissions for an organization
Return Type
- ActionsGetDefaultWorkflowPermissions|error - Response
put orgs/[string org]/actions/permissions/workflow
function put orgs/[string org]/actions/permissions/workflow(ActionsSetDefaultWorkflowPermissions payload) returns error?
Set default workflow permissions for an organization
Parameters
- payload ActionsSetDefaultWorkflowPermissions -
Return Type
- error? - Success response
get orgs/[string org]/actions/runners
function get orgs/[string org]/actions/runners(string? name, int per_page, int page) returns RunnerResponse|error
List self-hosted runners for an organization
Parameters
- name string? (default ()) - The name of a self-hosted runner.
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- RunnerResponse|error - Response
get orgs/[string org]/actions/runners/downloads
function get orgs/[string org]/actions/runners/downloads() returns RunnerApplication[]|error
List runner applications for an organization
Return Type
- RunnerApplication[]|error - Response
post orgs/[string org]/actions/runners/generate-jitconfig
function post orgs/[string org]/actions/runners/generate\-jitconfig(Runners_generatejitconfig_body payload) returns JitConfig|error
Create configuration for a just-in-time runner for an organization
Parameters
- payload Runners_generatejitconfig_body -
post orgs/[string org]/actions/runners/registration-token
function post orgs/[string org]/actions/runners/registration\-token() returns AuthenticationToken|error
Create a registration token for an organization
Return Type
- AuthenticationToken|error - Response
post orgs/[string org]/actions/runners/remove-token
function post orgs/[string org]/actions/runners/remove\-token() returns AuthenticationToken|error
Create a remove token for an organization
Return Type
- AuthenticationToken|error - Response
get orgs/[string org]/actions/runners/[int runner_id]
Get a self-hosted runner for an organization
delete orgs/[string org]/actions/runners/[int runner_id]
function delete orgs/[string org]/actions/runners/[int runner_id]() returns error?
Delete a self-hosted runner from an organization
Return Type
- error? - Response
get orgs/[string org]/actions/runners/[int runner_id]/labels
function get orgs/[string org]/actions/runners/[int runner_id]/labels() returns RunnerLabelResponse|error
List labels for a self-hosted runner for an organization
Return Type
- RunnerLabelResponse|error - Response
put orgs/[string org]/actions/runners/[int runner_id]/labels
function put orgs/[string org]/actions/runners/[int runner_id]/labels(Runner_id_labels_body payload) returns RunnerLabelResponse|error
Set custom labels for a self-hosted runner for an organization
Parameters
- payload Runner_id_labels_body -
Return Type
- RunnerLabelResponse|error - Response
post orgs/[string org]/actions/runners/[int runner_id]/labels
function post orgs/[string org]/actions/runners/[int runner_id]/labels(Runner_id_labels_body_1 payload) returns RunnerLabelResponse|error
Add custom labels to a self-hosted runner for an organization
Parameters
- payload Runner_id_labels_body_1 -
Return Type
- RunnerLabelResponse|error - Response
delete orgs/[string org]/actions/runners/[int runner_id]/labels
function delete orgs/[string org]/actions/runners/[int runner_id]/labels() returns RunnerLabelResponse|error
Remove all custom labels from a self-hosted runner for an organization
Return Type
- RunnerLabelResponse|error - Response
delete orgs/[string org]/actions/runners/[int runner_id]/labels/[string name]
function delete orgs/[string org]/actions/runners/[int runner_id]/labels/[string name]() returns RunnerLabelResponse|error
Remove a custom label from a self-hosted runner for an organization
Return Type
- RunnerLabelResponse|error - Response
get orgs/[string org]/actions/secrets
function get orgs/[string org]/actions/secrets(int per_page, int page) returns OrganizationActionsSecretResponse|error
List organization secrets
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- OrganizationActionsSecretResponse|error - Response
get orgs/[string org]/actions/secrets/public-key
function get orgs/[string org]/actions/secrets/public\-key() returns ActionsPublicKey|error
Get an organization public key
Return Type
- ActionsPublicKey|error - Response
get orgs/[string org]/actions/secrets/[string secret_name]
function get orgs/[string org]/actions/secrets/[string secret_name]() returns OrganizationActionsSecret|error
Get an organization secret
Return Type
- OrganizationActionsSecret|error - Response
put orgs/[string org]/actions/secrets/[string secret_name]
function put orgs/[string org]/actions/secrets/[string secret_name](Secrets_secret_name_body payload) returns EmptyObject|error?
Create or update an organization secret
Parameters
- payload Secrets_secret_name_body -
Return Type
- EmptyObject|error? - Response when creating a secret
delete orgs/[string org]/actions/secrets/[string secret_name]
function delete orgs/[string org]/actions/secrets/[string secret_name]() returns error?
Delete an organization secret
Return Type
- error? - Response
get orgs/[string org]/actions/secrets/[string secret_name]/repositories
function get orgs/[string org]/actions/secrets/[string secret_name]/repositories(int page, int per_page) returns MinimalRepositoryResponse|error
List selected repositories for an organization secret
Parameters
- page int (default 1) - Page number of the results to fetch.
- per_page int (default 30) - The number of results per page (max 100).
Return Type
- MinimalRepositoryResponse|error - Response
put orgs/[string org]/actions/secrets/[string secret_name]/repositories
function put orgs/[string org]/actions/secrets/[string secret_name]/repositories(Secret_name_repositories_body payload) returns error?
Set selected repositories for an organization secret
Parameters
- payload Secret_name_repositories_body -
Return Type
- error? - Response
put orgs/[string org]/actions/secrets/[string secret_name]/repositories/[int repository_id]
function put orgs/[string org]/actions/secrets/[string secret_name]/repositories/[int repository_id]() returns Response|error
Add selected repository to an organization secret
delete orgs/[string org]/actions/secrets/[string secret_name]/repositories/[int repository_id]
function delete orgs/[string org]/actions/secrets/[string secret_name]/repositories/[int repository_id]() returns Response|error
Remove selected repository from an organization secret
get orgs/[string org]/actions/variables
function get orgs/[string org]/actions/variables(int per_page, int page) returns OrganizationActionsVariableResponse|error
List organization variables
Parameters
- per_page int (default 10) - The number of results per page (max 30).
- page int (default 1) - Page number of the results to fetch.
Return Type
- OrganizationActionsVariableResponse|error - Response
post orgs/[string org]/actions/variables
function post orgs/[string org]/actions/variables(Actions_variables_body payload) returns EmptyObject|error
Create an organization variable
Parameters
- payload Actions_variables_body -
Return Type
- EmptyObject|error - Response when creating a variable
get orgs/[string org]/actions/variables/[string name]
function get orgs/[string org]/actions/variables/[string name]() returns OrganizationActionsVariable|error
Get an organization variable
Return Type
- OrganizationActionsVariable|error - Response
delete orgs/[string org]/actions/variables/[string name]
function delete orgs/[string org]/actions/variables/[string name]() returns error?
Delete an organization variable
Return Type
- error? - Response
patch orgs/[string org]/actions/variables/[string name]
function patch orgs/[string org]/actions/variables/[string name](Variables_name_body payload) returns error?
Update an organization variable
Parameters
- payload Variables_name_body -
Return Type
- error? - Response
get orgs/[string org]/actions/variables/[string name]/repositories
function get orgs/[string org]/actions/variables/[string name]/repositories(int page, int per_page) returns MinimalRepositoryResponse|error
List selected repositories for an organization variable
Parameters
- page int (default 1) - Page number of the results to fetch.
- per_page int (default 30) - The number of results per page (max 100).
Return Type
- MinimalRepositoryResponse|error - Response
put orgs/[string org]/actions/variables/[string name]/repositories
function put orgs/[string org]/actions/variables/[string name]/repositories(Name_repositories_body payload) returns Response|error
Set selected repositories for an organization variable
Parameters
- payload Name_repositories_body -
put orgs/[string org]/actions/variables/[string name]/repositories/[int repository_id]
function put orgs/[string org]/actions/variables/[string name]/repositories/[int repository_id]() returns Response|error
Add selected repository to an organization variable
delete orgs/[string org]/actions/variables/[string name]/repositories/[int repository_id]
function delete orgs/[string org]/actions/variables/[string name]/repositories/[int repository_id]() returns Response|error
Remove selected repository from an organization variable
get orgs/[string org]/blocks
function get orgs/[string org]/blocks(int per_page, int page) returns SimpleUser[]|error
List users blocked by an organization
Parameters
- per_page int (default 30) - The number of results per page (max 100).
- page int (default 1) - Page number of the results to fetch.
Return Type
- SimpleUser[]|error - Response
get orgs/[string org]/blocks/[string username]
Check if a user is blocked by an organization
put orgs/[string org]/blocks/[string username]
Block a user from an organization
delete orgs/[string org]/blocks/[string username]
function delete orgs/[string org]/blocks/[string username]() returns error?
Unblock a user from an organization
Return Type
- error? - Response
get orgs/[string org]/code-scanning/alerts
function get orgs/[string org]/code\-scanning/alerts(CodeScanningAnalysisToolName? tool_name, CodeScanningAnalysisToolGuid? tool_guid, string? before, string? after, int page, int per_page, "asc"|"desc" direction, CodeScanningAlertStateQuery? state, "created"|"updated" sort, CodeScanningAlertSeverity? severity) returns CodeScanningOrganizationAlertItems[]|error
List code scanning alerts for an organization
Parameters
- tool_name CodeScanningAnalysisToolName? (default ()) - The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either
tool_name
ortool_guid
, but not both.
- tool_guid CodeScanningAnalysisToolGuid? (default ()) - The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either
tool_guid
ortool_name
, but not both.
- before string? (default ()) - A cursor, as given in the Link header. If specified, the query only searches for results before this cursor.
- after string? (default ()) - A cursor, as given in the Link header. If specified, the query only searches for results after this cursor.
- page int (default 1) - Page number of the results to fetch.
- per_page int (default 30) - The number of results per page (max 100).
- direction "asc"|"desc" (default "desc") - The direction to sort the results by.
- state CodeScanningAlertStateQuery? (default ()) - If specified, only code scanning alerts with this state will be returned.
- sort "created"|"updated" (default "created") - The property by which to sort the results.
- severity CodeScanningAlertSeverity? (default ()) - If specified, only code scanning alerts with this severity will be returned.
Return Type
- CodeScanningOrganizationAlertItems[]|error - Response
get orgs/[string org]/codespaces
function get orgs/[string org]/codespaces(int pe