# List GitHub pull requests

> Lists a repository's pull requests, newest first, up to 100. Needs the token permission Pull requests Read.

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

## At a glance

| Property | Value |
| --- | --- |
| **Step name** | `github-list-pulls` |
| **Resource** | ClusterStep (`lumen.ai/v1alpha1`) |
| **Palette group, category** | read, github |
| **Credits** | **0.2** credits each time it succeeds |
| **Side effects** | no |
| **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 |
| --- | --- |
| `pulls` | array |
| `count` | number |
| `truncated` | boolean |

## 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` (required) | string |  | owner/name, such as acme/website. (minLength 1; maxLength 200) |
| `state` | string | `"open"` | Which (one of open, closed, all) |
| `max` | integer | `20` | Max caps the pull requests returned: 1 to 100, default 20. (minimum 1; maximum 100) |

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

## Example

Open pull requests for a weekly summary

```yaml title="config"
max: 10
repo: acme/website
state: open
```

## Use it in a flow

A node that runs `github-list-pulls` 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-list-pulls-example
  namespace: tenant-acme
spec:
  displayName: "List GitHub pull requests"
  triggers:
    - id: start
      ref: {name: manual-run}
      next: [github-list-pulls]
  nodes:
    - id: github-list-pulls
      stepRef: {name: github-list-pulls}
      config:
        max: 10
        repo: acme/website
        state: open
```
