Skip to content

Instantly share code, notes, and snippets.

View amenocal's full-sized avatar

Alejandro Menocal amenocal

  • GitHub Staff
  • Houston, TX
View GitHub Profile
@amenocal
amenocal / GetPRCheckRuns.gql
Created August 23, 2022 16:21
GraphQL get CheckRuns for latest commit
query FullPullRequestQuery(
$repositoryOwner: String!
$repositoryName: String!
$pullRequestNumber: Int!
) {
repository(owner: $repositoryOwner, name: $repositoryName) {
pullRequest(number: $pullRequestNumber) {
id
state # PR state. For example, { "OPEN", "MERGED", "CLOSED" }
isDraft # Identifies if the pull request is a draft.
@amenocal
amenocal / getorg-deploykeys.gql
Last active October 6, 2022 21:41
Get Deploy Keys of an Organization
query ($login: String!, $endCursor: String) {
organization(login: $login) {
repositories(first: 10, after: $endCursor) {
pageInfo {
endCursor
hasNextPage
}
nodes {
name
deployKeys(first: 100) {
@amenocal
amenocal / org-repo-branch-protections
Created October 20, 2022 18:55
Repos with Branch Protections in an Org
gh api --paginate graphql -f organization=<orgname> -f query='query($organization: String!, $endCursor: String) {
organization(login: $organization) {
login
repositories(first: 100, after: $endCursor) {
nodes {
nameWithOwner
branchProtectionRules(first: 100, after: $endCursor) {
totalCount
nodes {
repository {
@amenocal
amenocal / gh-copilot-api-calls.md
Last active August 29, 2025 10:28
gh copilot api

Copilot API Calls Example

Telemetry

export ORG=<YOUR-ORG>
  • Get Business seat information and settings for an org