# Label on GitHub

> Adds or removes labels on an issue or pull request. Needs the token permission Issues (or Pull requests) Read and write.

Source: https://docs.go-lumen.ai/reference/steps/github-labels

## At a glance

| Property | Value |
| --- | --- |
| **Step name** | `github-labels` |
| **Resource** | ClusterStep (`lumen.ai/v1alpha1`) |
| **Palette group, category** | save, github |
| **Credits** | **0.5** credits each time it succeeds |
| **Side effects** | yes: It changes something outside Lumen, so a retry asks first and a test shows what it would do instead of doing it. |
| **Installation must provide** | nothing |

## Inputs

| Property | Value |
| --- | --- |
| **Needs** | nothing |
| **Produces** | `fields` |
| **Works on** | item: one document at a time |

Needs and Produces are data types (file, text, fields, email). The editor offers a step only where what it needs is already on the path. See [Documents and data](https://docs.go-lumen.ai/concepts/how-flows-run.md#documents-and-data).

## Outputs

A later node references an output as `{nodeId.field}` in text, or `nodeId.field` in a condition.

| Output | Type |
| --- | --- |
| `repo` | string |
| `number` | number |
| `labels` | array |

## Settings

Set under `config:` on the flow node. Text settings may contain `{nodeId.field}` placeholders.

| Setting | Type | Default | Description |
| --- | --- | --- | --- |
| `connectorRef` | string |  | GitHub connection (minLength 1) |
| `repo` | string |  | owner/name, such as acme/website. Empty is the repository the flow started from. (maxLength 200) |
| `number` | string |  | Empty is the one the flow started from. (maxLength 100) |
| `add` | list of string |  | Add labels (maxItems 20) |
| `remove` | list of string |  | Remove labels (maxItems 20) |

The full JSON Schema of these settings: [github-labels.schema.json](https://docs.go-lumen.ai/schemas/steps/github-labels.schema.json).

## Example

Mark a report as triaged

```yaml title="config"
add:
- triaged
remove:
- needs-triage
```

## Use it in a flow

A node that runs `github-labels` goes under `spec.nodes` of a [Flow](https://docs.go-lumen.ai/concepts/how-flows-run.md#the-flow-as-yaml). Give it any id, and list the next node ids in next.

```yaml title="flow.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: github-labels-example
  namespace: tenant-acme
spec:
  displayName: "Label on GitHub"
  triggers:
    - id: start
      ref: {name: manual-run}
      next: [github-labels]
  nodes:
    - id: github-labels
      stepRef: {name: github-labels}
      config:
        add:
        - triaged
        remove:
        - needs-triage
```
