- Label sync. On repository events (push, schedule, manual dispatch, repository dispatch and merge queue), it makes the repository’s labels match the
labelssection. - Labelling. On pull request and issue events, it adds and removes labels on the subject as its
labellingrules pass and fail.
labels or a labelling section.
Label sync
Each entry inlabels is keyed by an id you choose, and has a name, a color (six hex digits, with or without #), and optionally a description and aliases.
- A configured label is matched to a repository label by name, ignoring case, and updated when its colour or description differs.
- Failing that, a repository label named in
aliasesis renamed, so issues carrying the old name keep the label. Exact names are matched before aliases, so an alias never takes a label another entry names directly. - Anything else is created.
- A
descriptionleft out of the config is left as it is on GitHub. - GitHub accepts descriptions of up to 100 characters. A label with a longer one is reported as an error and left as it is, and the rest still sync.
- When two entries name the same label, ignoring case, only the first is synced, with a warning.
- With
labelSync.prune: true, repository labels the config does not define are deleted. A label named in an entry’saliasescounts as defined, even when the entry’s own name already exists. Pruning is off by default.
v1’s
skipDelete input deleted unconfigured labels unless it was set. v2 never deletes a label unless labelSync.prune is true.Labelling
Each rule inlabelling names a label, an optional on (pullRequest, issue, or both by default), and a when condition group.
labelis a key oflabels, and the label’snameis what gets applied. A value that is not a key is used as the label’s name itself.- A label is added when any rule for it passes, and removed when every rule for it fails. Several rules may name the same label, for example one per subject kind.
- Names compare ignoring case, as GitHub does.
- If a label has already gone when smartcloud removes it, that is a warning, not a failure.
- If GitHub forbids adding or removing a label, as it does on the read-only token of a pull request from a fork, that is a warning (
labels.addorlabels.remove), not a failure, and the rest of the run carries on.