diff --git a/packages/sync-repo-settings/src/schema.json b/packages/sync-repo-settings/src/schema.json index 31478e5a110..36bdd7aec3a 100644 --- a/packages/sync-repo-settings/src/schema.json +++ b/packages/sync-repo-settings/src/schema.json @@ -5,6 +5,10 @@ "type": "object", "additionalProperties": false, "properties": { + "enabled": { + "description": "Whether or not the sync-repo-settings bot is enabled.", + "type": "boolean" + }, "squashMergeAllowed": { "description": "Whether or not squash-merging is enabled on this repository.", "type": "boolean" diff --git a/packages/sync-repo-settings/src/sync-repo-settings.ts b/packages/sync-repo-settings/src/sync-repo-settings.ts index eb2af306716..488f42542ae 100644 --- a/packages/sync-repo-settings/src/sync-repo-settings.ts +++ b/packages/sync-repo-settings/src/sync-repo-settings.ts @@ -48,6 +48,7 @@ function deepFreeze(object: any) { const languageConfig: LanguageConfig = deepFreeze(checks); const repoConfigDefaults: RepoConfig = deepFreeze({ + enabled: true, mergeCommitAllowed: false, squashMergeAllowed: true, rebaseMergeAllowed: true, @@ -82,6 +83,10 @@ export class SyncRepoSettings { const logger = this.logger; const repo = options.repo; const [owner, name] = repo.split('/'); + if (config?.enabled === false) { + logger.info(`config is not enabled for repository ${repo}`); + return; + } if (!config) { logger.info(`no local config found for ${repo}, checking global config`); // Fetch the list of languages used in this repository diff --git a/packages/sync-repo-settings/src/types.ts b/packages/sync-repo-settings/src/types.ts index 28ec0db5a3a..9e697d60e4e 100644 --- a/packages/sync-repo-settings/src/types.ts +++ b/packages/sync-repo-settings/src/types.ts @@ -13,6 +13,10 @@ // limitations under the License. export interface RepoConfig { + /** + * Whether or not the sync-repo-settings bot is enabled. + */ + enabled?: boolean; /** * Whether or not squash-merging is enabled on this repository. */