Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions gh-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,19 @@ The list will contain the repository name, source (CODEOWNERS file), and kind of

Repositories with no CODEONWERS files or CODEOWNERS errors will not be listed.

### get-organization-database-id-for-vnet.sh

Retrieves the databaseId of an organization for use with VNet injection configuration.

Usage:

```shell
./get-organization-databaseId-for-vnet.sh <organization>
```

> [!NOTE]
> See [Configuring private networking for GitHub-hosted runners in your organization](https://docs.github.com/en/organizations/managing-organization-settings/configuring-private-networking-for-github-hosted-runners-in-your-organization#1-obtain-the-databaseid-for-your-organization) for more information on using the databaseId with VNet injection

### get-organization-id.sh

Get the organization ID used for other GraphQL calls. Use the login of the Organization as the input.
Expand Down
21 changes: 21 additions & 0 deletions gh-cli/get-organization-database-id-for-vnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# This script retrieves the databaseId of your organization to be used in the Vnet injection scripts
# https://docs.github.com/en/organizations/managing-organization-settings/configuring-private-networking-for-github-hosted-runners-in-your-organization#1-obtain-the-databaseid-for-your-organization

if [ -z "$1" ]; then
echo "Usage: $0 <org>"
echo "Example: ./get-organization-database-id-for-vnet.sh joshjohanning-org"
exit 1
fi

org="$1"

gh api graphql -f organization="$org" -f query='
query ($organization: String!)
{ organization(login: $organization) {
login
databaseId
}
}
'
2 changes: 1 addition & 1 deletion gh-cli/get-organization-id.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [ -z "$1" ]; then
echo "Usage: $0 <org>"
echo "Example: ./get-enterprise-id.sh joshjohanning-org"
echo "Example: ./get-organization-id.sh joshjohanning-org"
exit 1
fi

Expand Down