update example configs to use v3 schema

This commit is contained in:
bkellam 2025-04-01 10:26:46 -07:00
parent 2d5e2584ca
commit f759bb2bb6
6 changed files with 30 additions and 108 deletions

View file

@ -1,39 +1,13 @@
{
"$schema": "../schemas/v2/index.json",
"repos": [
// Authenticate using a token directly in the config.
// Private and public repositories will be included.
{
"type": "github",
"token": "ghp_token1234",
"orgs": [
"my-org"
]
},
{
"type": "gitlab",
"token": "glpat-1234",
"groups": [
"my-group"
]
},
{
"type": "gitea",
"token": "gitea-token",
"orgs": [
"my-org"
]
},
// You can also store the token in a environment variable and then
// references it from the config.
{
"$schema": "../schemas/v3/index.json",
"connections": {
"example-1": {
"type": "github",
"token": {
"env": "GITHUB_TOKEN_ENV_VAR"
}
},
{
"example-2": {
"type": "gitlab",
"token": {
"env": "GITLAB_TOKEN_ENV_VAR"
@ -42,7 +16,7 @@
"my-group"
]
},
{
"example-3": {
"type": "gitea",
"token": {
"env": "GITEA_TOKEN_ENV_VAR"
@ -51,5 +25,5 @@
"my-org"
]
}
]
}
}

View file

@ -1,15 +1,14 @@
{
"$schema": "../schemas/v2/index.json",
"$schema": "../schemas/v3/index.json",
// Note: to include private repositories, you must provide an authentication token.
// See: configs/auth.json for a example.
"repos": [
"connections": {
// From GitHub, include:
// - all public repos owned by user `torvalds`
// - all public repos owned by organization `commai`
// - repo `sourcebot-dev/sourcebot`
{
"example-1": {
"type": "github",
"token": "my-token",
"users": [
"torvalds"
],
@ -24,9 +23,8 @@
// - all public projects owned by user `brendan67`
// - all public projects in group `my-group` and sub-group `sub-group`
// - project `my-group/project1`
{
"example-2": {
"type": "gitlab",
"token": "my-token",
"users": [
"brendan67"
],
@ -42,9 +40,8 @@
// - all public repos owned by user `my-user`
// - all public repos owned by organization `my-org`
// - repo `my-org/my-repo`
{
"example-3": {
"type": "gitea",
"token": "my-token",
"users": [
"my-user"
],
@ -54,20 +51,6 @@
"repos": [
"my-org/my-repo"
]
},
// Index a local repository
{
"type": "local",
"path": "/path/to/local/repo"
},
// Index all projects in a self-hosted GitLab instance
// that are visible to the provided token.
// Note: this does not work with gitlab.com
{
"type": "gitlab",
"url": "https://gitlab.example.com",
"token": "my-token",
"all": true
}
]
}
}

View file

@ -1,12 +1,11 @@
{
"$schema": "../schemas/v2/index.json",
"repos": [
"$schema": "../schemas/v3/index.json",
"connections": {
// Include all repos in my-org, except:
// - repo1 & repo2
// - repos that are archived or forks
{
"example-1": {
"type": "github",
"token": "my-token",
"orgs": [
"my-org"
],
@ -25,9 +24,8 @@
// Include all projects in my-group, except:
// - project1 & project2
// - projects that are archived or forks
{
"example-2": {
"type": "gitlab",
"token": "my-token",
"groups": [
"my-group"
],
@ -46,9 +44,8 @@
// Include all repos in my-org, except:
// - repo1 & repo2
// - repos that are archived or forks
{
"example-3": {
"type": "gitea",
"token": "my-token",
"orgs": [
"my-org"
],
@ -66,7 +63,7 @@
// Include all repos in my-org that have the topic
// "TypeScript" and do not have a topic that starts
// with "test-"
{
"example-4": {
"type": "github",
"orgs": [
"my-org"
@ -83,7 +80,7 @@
// Include all repos in my-group that have the topic
// "TypeScript" and do not have a topic that starts
// with "test-"
{
"example-5": {
"type": "gitlab",
"groups": [
"my-group"
@ -97,5 +94,5 @@
]
}
}
]
}
}

View file

@ -1,32 +0,0 @@
{
"$schema": "../schemas/v2/index.json",
"repos": [
{
"type": "local",
"path": "/path/to/local/repo"
},
// Relative paths are relative to the config file
{
"type": "local",
"path": "../../relative/path/to/local/repo"
},
// File watcher can be disabled (enabled by default)
{
"type": "local",
"path": "/path/to/local/repo",
"watch": false
},
// Exclude paths can be specified
{
"type": "local",
"path": "/path/to/local/repo",
"exclude": {
"paths": [
".git",
"node_modules",
"dist"
]
}
}
]
}

View file

@ -1,7 +1,7 @@
{
"$schema": "../schemas/v2/index.json",
"repos": [
{
"$schema": "../schemas/v3/index.json",
"connections": {
"example-1": {
"type": "github",
"revisions": {
// Specify branches to index...
@ -22,5 +22,5 @@
"org/repob"
]
}
]
}
}

View file

@ -1,26 +1,26 @@
{
"$schema": "../schemas/v2/index.json",
"repos": [
{
"$schema": "../schemas/v3/index.json",
"connections": {
"example-1": {
"type": "github",
"url": "https://github.example.com",
"orgs": [
"my-org-name"
]
},
{
"example-2": {
"type": "gitlab",
"url": "https://gitlab.example.com",
"groups": [
"my-group"
]
},
{
"example-3": {
"type": "gitea",
"url": "https://gitea.example.com",
"orgs": [
"my-org-name"
]
}
]
}
}