> ## Documentation Index
> Fetch the complete documentation index at: https://smartcloud.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration reference

> Every key smartcloud accepts in .github/smartcloud.yml, generated from the JSON Schema.

This page is generated from [`schema/smartcloud.schema.json`](https://github.com/Resnovas/smartcloud/blob/main/schema/smartcloud.schema.json), which is generated from the Effect Schema in `packages/config`. The guides explain what each section does; this page lists every key.

## Top level

Declarative repository automation: labels, conventions and policy.

| Key               | Type                                                | Required | Notes                                                                                                                                                                                                                                                                                                            |
| ----------------- | --------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `$schema`         | string                                              | no       |                                                                                                                                                                                                                                                                                                                  |
| `version`         | `2`                                                 | yes      |                                                                                                                                                                                                                                                                                                                  |
| `extends`         | list of [ExtendsEntry](#extendsentry)               | no       |                                                                                                                                                                                                                                                                                                                  |
| `telemetry`       | boolean                                             | no       | Set to false to stop smartcloud sending anonymous telemetry (hashed usage events, logs, traces, metrics and errors) to PostHog. On by default; turning it off is discouraged, because telemetry is how problems are found and fixed. The telemetry page of the documentation lists what is and is not collected. |
| `labels`          | map of [RuleId](#ruleid) to [Label](#label)         | no       |                                                                                                                                                                                                                                                                                                                  |
| `labelSync`       | object                                              | no       |                                                                                                                                                                                                                                                                                                                  |
| `labelSync.prune` | boolean                                             | no       |                                                                                                                                                                                                                                                                                                                  |
| `labelling`       | map of [RuleId](#ruleid) to [LabelRule](#labelrule) | no       |                                                                                                                                                                                                                                                                                                                  |
| `conventions`     | [Conventions](#conventions)                         | no       |                                                                                                                                                                                                                                                                                                                  |
| `roles`           | [Roles](#roles)                                     | no       |                                                                                                                                                                                                                                                                                                                  |
| `links`           | [Links](#links)                                     | no       |                                                                                                                                                                                                                                                                                                                  |
| `commits`         | [Commits](#commits)                                 | no       |                                                                                                                                                                                                                                                                                                                  |
| `disclosure`      | [Disclosure](#disclosure)                           | no       |                                                                                                                                                                                                                                                                                                                  |
| `reviews`         | [Reviews](#reviews)                                 | no       |                                                                                                                                                                                                                                                                                                                  |
| `stale`           | [Stale](#stale)                                     | no       |                                                                                                                                                                                                                                                                                                                  |
| `settings`        | [Settings](#settings)                               | no       |                                                                                                                                                                                                                                                                                                                  |
| `sync`            | [Sync](#sync)                                       | no       |                                                                                                                                                                                                                                                                                                                  |

Other keys are an error.

## Types

### ExtendsEntry

A preset to extend, as owner/repo/path\@ref. The ref is optional. Pattern: `^(?!\.\.?\/)([A-Za-z0-9_.-]+)\/(?!\.\.?\/)([A-Za-z0-9_.-]+)\/((?!\.\.?(?:\/|@|$))[^/@]+(?:\/(?!\.\.?(?:\/|@|$))[^/@]+)*)(?:@([^@\s]+))?$`.

Type: string.

### Label

| Key           | Type            | Required | Notes |
| ------------- | --------------- | -------- | ----- |
| `name`        | string          | yes      |       |
| `color`       | [Color](#color) | yes      |       |
| `description` | string          | no       |       |
| `aliases`     | list of string  | no       |       |

Other keys are an error.

### Color

Six hex digits, for example 0E8A16. Pattern: `^#?[0-9a-fA-F]{6}$`.

Type: string.

### RuleId

A label or rule key. Pattern: `^\S[\s\S]*\S$|^\S$|^$`. At least 1 character(s).

Type: string.

### LabelRule

| Key     | Type                              | Required | Notes |
| ------- | --------------------------------- | -------- | ----- |
| `label` | [RuleId](#ruleid)                 | yes      |       |
| `on`    | [Subjects](#subjects)             | no       |       |
| `when`  | [ConditionGroup](#conditiongroup) | yes      |       |

Other keys are an error.

### Subjects

The subjects a rule applies to. Omitted means pull requests and issues.

Type: list of one of `pullRequest`, `issue`.

### ConditionGroup

| Key         | Type                              | Required | Notes |
| ----------- | --------------------------------- | -------- | ----- |
| `requires`  | [NonNegativeInt](#nonnegativeint) | no       |       |
| `condition` | list of [Condition](#condition)   | yes      |       |

Other keys are an error.

### NonNegativeInt

Minimum: 0.

Type: integer.

### Condition

Type: any of [titleMatches](#titlematches), [descriptionMatches](#descriptionmatches), [creatorMatches](#creatormatches), [branchMatches](#branchmatches), [isOpen](#isopen), [isLocked](#islocked), [isDraft](#isdraft), [pendingReview](#pendingreview), [requestedChanges](#requestedchanges), [commitsSignedOff](#commitssignedoff), [hasLabel](#haslabel), [isStale](#isstale), [isAbandoned](#isabandoned), [filesMatch](#filesmatch), [changesSize](#changessize), [isApproved](#isapproved), [commitMessagesMatch](#commitmessagesmatch), [hasTrailer](#hastrailer), [$and](#and), [$or](#or), [$not](#not), [$only](#only).

### Pattern

Type: string.

### Conventions

| Key              | Type                                                          | Required | Notes |
| ---------------- | ------------------------------------------------------------- | -------- | ----- |
| `comment`        | object                                                        | no       |       |
| `comment.header` | string                                                        | no       |       |
| `comment.footer` | string                                                        | no       |       |
| `rules`          | map of [RuleId](#ruleid) to [ConventionRule](#conventionrule) | no       |       |

Other keys are an error.

### ConventionRule

| Key        | Type                                                                       | Required | Notes |
| ---------- | -------------------------------------------------------------------------- | -------- | ----- |
| `on`       | [Subjects](#subjects)                                                      | no       |       |
| `level`    | one of `error`, `warning`                                                  | no       |       |
| `message`  | string                                                                     | no       |       |
| `preset`   | one of `conventionalCommits`, `semanticTitle`, `gitmojis`, `semanticEmoji` | no       |       |
| `contexts` | list of string                                                             | no       |       |
| `when`     | [ConditionGroup](#conditiongroup)                                          | no       |       |

Other keys are an error.

### Roles

| Key           | Type           | Required | Notes |
| ------------- | -------------- | -------- | ----- |
| `maintainers` | list of string | no       |       |
| `trustedBots` | list of string | no       |       |

Other keys are an error.

### Links

| Key          | Type   | Required | Notes |
| ------------ | ------ | -------- | ----- |
| `policyBase` | string | no       |       |

Other keys are an error.

### Commits

| Key                   | Type            | Required | Notes |
| --------------------- | --------------- | -------- | ----- |
| `dco`                 | boolean         | no       |       |
| `aiAttribution`       | boolean         | no       |       |
| `aiIdentities`        | object          | no       |       |
| `aiIdentities.emails` | list of string  | no       |       |
| `aiIdentities.names`  | list of string  | no       |       |
| `maintainerLevel`     | [Level](#level) | no       |       |

Other keys are an error.

### Level

Type: one of `error`, `warning`.

### Disclosure

| Key                  | Type            | Required | Notes |
| -------------------- | --------------- | -------- | ----- |
| `fields`             | object          | no       |       |
| `fields.level`       | string          | no       |       |
| `fields.tools`       | string          | no       |       |
| `fields.accountable` | string          | no       |       |
| `fields.review`      | string          | no       |       |
| `requireDraft`       | boolean         | no       |       |
| `maintainerLevel`    | [Level](#level) | no       |       |

Other keys are an error.

### Reviews

| Key                | Type                                                   | Required | Notes |
| ------------------ | ------------------------------------------------------ | -------- | ----- |
| `gate`             | object                                                 | no       |       |
| `gate.outside`     | [NonNegativeInt](#nonnegativeint)                      | no       |       |
| `gate.maintainer`  | [NonNegativeInt](#nonnegativeint)                      | no       |       |
| `requestApprovals` | map of string to [RequestApproval](#requestapproval)   | no       |       |
| `automaticApprove` | map of string to [AutomaticApprove](#automaticapprove) | no       |       |

Other keys are an error.

### RequestApproval

| Key         | Type                              | Required | Notes |
| ----------- | --------------------------------- | -------- | ----- |
| `reviewers` | list of string                    | yes      |       |
| `when`      | [ConditionGroup](#conditiongroup) | yes      |       |

Other keys are an error.

### AutomaticApprove

| Key       | Type                              | Required | Notes |
| --------- | --------------------------------- | -------- | ----- |
| `when`    | [ConditionGroup](#conditiongroup) | yes      |       |
| `message` | string                            | no       |       |

Other keys are an error.

### Stale

| Key                  | Type                                  | Required | Notes |
| -------------------- | ------------------------------------- | -------- | ----- |
| `on`                 | list of one of `pullRequest`, `issue` | no       |       |
| `staleAfterDays`     | [NonNegative](#nonnegative)           | yes      |       |
| `staleLabel`         | string                                | yes      |       |
| `staleComment`       | string                                | no       |       |
| `abandonedAfterDays` | [NonNegative](#nonnegative)           | no       |       |
| `abandonedLabel`     | string                                | no       |       |
| `abandonedComment`   | string                                | no       |       |
| `close`              | boolean                               | no       |       |
| `exempt`             | object                                | no       |       |
| `exempt.labels`      | list of string                        | no       |       |
| `exempt.when`        | [ConditionGroup](#conditiongroup)     | no       |       |

Other keys are an error.

### NonNegative

Minimum: 0.

Type: number.

### Settings

| Key                                        | Type                                                                           | Required | Notes                                                               |
| ------------------------------------------ | ------------------------------------------------------------------------------ | -------- | ------------------------------------------------------------------- |
| `merging`                                  | object                                                                         | no       |                                                                     |
| `merging.mergeCommit`                      | boolean                                                                        | no       |                                                                     |
| `merging.squash`                           | boolean                                                                        | no       |                                                                     |
| `merging.rebase`                           | boolean                                                                        | no       |                                                                     |
| `merging.autoMerge`                        | boolean                                                                        | no       |                                                                     |
| `merging.updateBranch`                     | boolean                                                                        | no       |                                                                     |
| `merging.deleteBranchOnMerge`              | boolean                                                                        | no       |                                                                     |
| `merging.webCommitSignoff`                 | boolean                                                                        | no       |                                                                     |
| `merging.squashTitle`                      | one of `PR_TITLE`, `COMMIT_OR_PR_TITLE`                                        | no       |                                                                     |
| `merging.squashMessage`                    | one of `COMMIT_MESSAGES`, `PR_BODY`, `BLANK`                                   | no       |                                                                     |
| `features`                                 | object                                                                         | no       |                                                                     |
| `features.wiki`                            | boolean                                                                        | no       |                                                                     |
| `features.discussions`                     | boolean                                                                        | no       |                                                                     |
| `features.sponsorships`                    | boolean                                                                        | no       |                                                                     |
| `security`                                 | object                                                                         | no       |                                                                     |
| `security.immutableReleases`               | boolean                                                                        | no       |                                                                     |
| `security.privateVulnerabilityReporting`   | boolean                                                                        | no       |                                                                     |
| `security.dependabotAlerts`                | boolean                                                                        | no       |                                                                     |
| `security.dependabotSecurityUpdates`       | boolean                                                                        | no       |                                                                     |
| `security.codeScanning`                    | one of `default`, `extended`, `off`                                            | no       |                                                                     |
| `security.secretScanning`                  | boolean                                                                        | no       |                                                                     |
| `ruleset`                                  | object                                                                         | no       |                                                                     |
| `ruleset.name`                             | string                                                                         | no       |                                                                     |
| `ruleset.linearHistory`                    | boolean                                                                        | no       |                                                                     |
| `ruleset.blockDeletion`                    | boolean                                                                        | no       |                                                                     |
| `ruleset.blockForcePush`                   | boolean                                                                        | no       |                                                                     |
| `ruleset.copilotReview`                    | boolean                                                                        | no       |                                                                     |
| `ruleset.codeScanningGate`                 | boolean                                                                        | no       |                                                                     |
| `ruleset.requiredChecks`                   | list of string                                                                 | no       |                                                                     |
| `ruleset.adminBypass`                      | boolean                                                                        | no       |                                                                     |
| `environments`                             | object                                                                         | no       |                                                                     |
| `environments.projectType`                 | one of `saas`, `desktop`, `library`, `none`                                    | no       |                                                                     |
| `environments.names`                       | list of string                                                                 | no       |                                                                     |
| `actions`                                  | object                                                                         | no       |                                                                     |
| `actions.enabled`                          | boolean                                                                        | no       |                                                                     |
| `actions.allowedActions`                   | one of `all`, `local_only`, `selected`                                         | no       |                                                                     |
| `actions.shaPinningRequired`               | boolean                                                                        | no       |                                                                     |
| `actions.selectedActions`                  | object                                                                         | no       |                                                                     |
| `actions.selectedActions.githubOwned`      | boolean                                                                        | no       |                                                                     |
| `actions.selectedActions.verifiedCreators` | boolean                                                                        | no       |                                                                     |
| `actions.selectedActions.patterns`         | list of string                                                                 | no       |                                                                     |
| `actions.workflowPermissions`              | one of `read`, `write`                                                         | no       |                                                                     |
| `actions.createPullRequests`               | boolean                                                                        | no       |                                                                     |
| `actions.accessLevel`                      | one of `none`, `user`, `organization`, `enterprise`                            | no       |                                                                     |
| `collaborators`                            | map of string to one of `read`, `triage`, `write`, `maintain`, `admin`, `none` | no       | Keys match `^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$`.            |
| `teams`                                    | map of string to one of `read`, `triage`, `write`, `maintain`, `admin`         | no       | Keys match `^[a-z0-9][a-z0-9_-]*$`.                                 |
| `webhooks`                                 | map of string to object                                                        | no       |                                                                     |
| `pages`                                    | object                                                                         | no       |                                                                     |
| `pages.enabled`                            | boolean                                                                        | no       |                                                                     |
| `pages.buildType`                          | one of `workflow`, `legacy`                                                    | no       |                                                                     |
| `pages.branch`                             | string                                                                         | no       |                                                                     |
| `pages.path`                               | one of `/`, `/docs`                                                            | no       |                                                                     |
| `pages.cname`                              | string                                                                         | no       |                                                                     |
| `pages.httpsEnforced`                      | boolean                                                                        | no       |                                                                     |
| `variables`                                | map of string to string                                                        | no       | Keys match `^(?![Gg][Ii][Tt][Hh][Uu][Bb]_)[A-Za-z_][A-Za-z0-9_]*$`. |

Other keys are an error.

### Sync

| Key               | Type                    | Required | Notes                           |
| ----------------- | ----------------------- | -------- | ------------------------------- |
| `source`          | string                  | yes      |                                 |
| `values`          | map of string to string | no       | Keys match `^[A-Z][A-Z0-9_]*$`. |
| `exclude`         | list of string          | no       |                                 |
| `branch`          | string                  | no       |                                 |
| `check`           | boolean                 | no       |                                 |
| `maintainerLevel` | [Level](#level)         | no       |                                 |

Other keys are an error.

## Conditions

Each condition is an object with a `type` naming it. See [Conditions](/conditions) for how groups and combinators evaluate.

### titleMatches

The title matches a pattern.

| Key         | Type                | Required | Notes |
| ----------- | ------------------- | -------- | ----- |
| `type`      | `titleMatches`      | yes      |       |
| `condition` | [Pattern](#pattern) | yes      |       |

Other keys are an error.

### descriptionMatches

The description matches a pattern.

| Key         | Type                 | Required | Notes |
| ----------- | -------------------- | -------- | ----- |
| `type`      | `descriptionMatches` | yes      |       |
| `condition` | [Pattern](#pattern)  | yes      |       |

Other keys are an error.

### creatorMatches

The author's login matches a pattern.

| Key         | Type                | Required | Notes |
| ----------- | ------------------- | -------- | ----- |
| `type`      | `creatorMatches`    | yes      |       |
| `condition` | [Pattern](#pattern) | yes      |       |

Other keys are an error.

### branchMatches

The pull request's head branch matches a pattern.

| Key         | Type                | Required | Notes |
| ----------- | ------------------- | -------- | ----- |
| `type`      | `branchMatches`     | yes      |       |
| `condition` | [Pattern](#pattern) | yes      |       |

Other keys are an error.

### isOpen

The subject is open, or closed when false.

| Key         | Type     | Required | Notes |
| ----------- | -------- | -------- | ----- |
| `type`      | `isOpen` | yes      |       |
| `condition` | boolean  | yes      |       |

Other keys are an error.

### isLocked

The conversation is locked, or unlocked when false.

| Key         | Type       | Required | Notes |
| ----------- | ---------- | -------- | ----- |
| `type`      | `isLocked` | yes      |       |
| `condition` | boolean    | yes      |       |

Other keys are an error.

### isDraft

The pull request is a draft, or ready when false.

| Key         | Type      | Required | Notes |
| ----------- | --------- | -------- | ----- |
| `type`      | `isDraft` | yes      |       |
| `condition` | boolean   | yes      |       |

Other keys are an error.

### pendingReview

Requested reviewers have not reviewed yet.

| Key         | Type            | Required | Notes |
| ----------- | --------------- | -------- | ----- |
| `type`      | `pendingReview` | yes      |       |
| `condition` | boolean         | yes      |       |

Other keys are an error.

### requestedChanges

A reviewer's latest review requests changes.

| Key         | Type               | Required | Notes |
| ----------- | ------------------ | -------- | ----- |
| `type`      | `requestedChanges` | yes      |       |
| `condition` | boolean            | yes      |       |

Other keys are an error.

### commitsSignedOff

Every non-merge commit has a Signed-off-by trailer matching its author email.

| Key         | Type               | Required | Notes |
| ----------- | ------------------ | -------- | ----- |
| `type`      | `commitsSignedOff` | yes      |       |
| `condition` | boolean            | yes      |       |

Other keys are an error.

### hasLabel

The subject has the label, or lacks it when false.

| Key         | Type       | Required | Notes |
| ----------- | ---------- | -------- | ----- |
| `type`      | `hasLabel` | yes      |       |
| `label`     | string     | yes      |       |
| `condition` | boolean    | yes      |       |

Other keys are an error.

### isStale

No activity for at least this many days.

| Key         | Type      | Required | Notes                         |
| ----------- | --------- | -------- | ----------------------------- |
| `type`      | `isStale` | yes      |                               |
| `condition` | number    | yes      | A number of days. Minimum: 0. |

Other keys are an error.

### isAbandoned

Carries the stale label and has had no activity for at least this many days.

| Key         | Type          | Required | Notes                         |
| ----------- | ------------- | -------- | ----------------------------- |
| `type`      | `isAbandoned` | yes      |                               |
| `condition` | number        | yes      | A number of days. Minimum: 0. |
| `label`     | string        | yes      |                               |

Other keys are an error.

### filesMatch

At least one changed file matches a glob.

| Key         | Type         | Required | Notes |
| ----------- | ------------ | -------- | ----- |
| `type`      | `filesMatch` | yes      |       |
| `condition` | string       | yes      |       |

Other keys are an error.

### changesSize

Lines added plus deleted are at least min and below max.

| Key    | Type                              | Required | Notes |
| ------ | --------------------------------- | -------- | ----- |
| `type` | `changesSize`                     | yes      |       |
| `min`  | [NonNegativeInt](#nonnegativeint) | yes      |       |
| `max`  | [NonNegativeInt](#nonnegativeint) | no       |       |

Other keys are an error.

### isApproved

No reviewer is pending or requesting changes, and at least this many approved.

| Key         | Type                              | Required | Notes |
| ----------- | --------------------------------- | -------- | ----- |
| `type`      | `isApproved`                      | yes      |       |
| `condition` | [NonNegativeInt](#nonnegativeint) | yes      |       |

Other keys are an error.

### commitMessagesMatch

Commit messages match a pattern.

| Key         | Type                  | Required | Notes                                                               |
| ----------- | --------------------- | -------- | ------------------------------------------------------------------- |
| `type`      | `commitMessagesMatch` | yes      |                                                                     |
| `condition` | [Pattern](#pattern)   | yes      |                                                                     |
| `scope`     | one of `all`, `any`   | no       | Whether every commit (all) or at least one commit (any) must match. |

Other keys are an error.

### hasTrailer

Commits carry the trailer, with a value matching the pattern when one is given.

| Key         | Type                | Required | Notes                                                               |
| ----------- | ------------------- | -------- | ------------------------------------------------------------------- |
| `type`      | `hasTrailer`        | yes      |                                                                     |
| `trailer`   | string              | yes      |                                                                     |
| `condition` | [Pattern](#pattern) | no       |                                                                     |
| `scope`     | one of `all`, `any` | no       | Whether every commit (all) or at least one commit (any) must match. |

Other keys are an error.

### \$and

Every group passes.

| Key         | Type                                      | Required | Notes |
| ----------- | ----------------------------------------- | -------- | ----- |
| `type`      | `$and`                                    | yes      |       |
| `condition` | list of [ConditionGroup](#conditiongroup) | yes      |       |

Other keys are an error.

### \$or

At least one group passes.

| Key         | Type                                      | Required | Notes |
| ----------- | ----------------------------------------- | -------- | ----- |
| `type`      | `$or`                                     | yes      |       |
| `condition` | list of [ConditionGroup](#conditiongroup) | yes      |       |

Other keys are an error.

### \$not

The group fails.

| Key         | Type                                                                                                                            | Required | Notes |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------- | -------- | ----- |
| `type`      | `$not`                                                                                                                          | yes      |       |
| `requires`  | [NonNegativeInt](#nonnegativeint)                                                                                               | no       |       |
| `condition` | any of [ConditionGroup](#conditiongroup), a one-item list of [ConditionGroup](#conditiongroup), list of [Condition](#condition) | yes      |       |

Other keys are an error.

### \$only

Exactly this many of the groups pass.

| Key         | Type                                      | Required | Notes |
| ----------- | ----------------------------------------- | -------- | ----- |
| `type`      | `$only`                                   | yes      |       |
| `requires`  | [NonNegativeInt](#nonnegativeint)         | yes      |       |
| `condition` | list of [ConditionGroup](#conditiongroup) | yes      |       |

Other keys are an error.
