Ensure a GitHub project field
github_project_field_ensureCreate a missing project board field or append missing single-select options while keeping existing option ids and order, so board columns match the workflow you need.
Instructions
Make sure a field exists on a project board the viewer may update, without ever making a second one: a missing field is created, and the missing options of an existing single select are appended after its own, which keep their id, name, color, description and order, so nothing already set moves. A new single_select field needs options. Status can be extended but not created. A field of that name with another type, options on a field that is not single_select, a repeated option name and a color GitHub does not list are invalid_argument, before anything is written. With issue_field: true (organization boards only) the column mirrors the organization's issue field of that name, such as Priority, Start date or Target date; it is added when the board lacks it, and a field of the board's own with that name is invalid_argument. A board is named by project: its number, owner/number or its URL, used as it is; any other project is a title, and no project is Roadmap: the open board of that whole title is looked up, never guessed, in owner's boards if owner is given, else in the boards linked to repo, then its organization's, then the viewer's. Needs a token with the project scope; if GitHub reports missing scopes, run gh auth refresh -s project.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The field's name, matched without regard to case. | |
| repo | No | owner/name; defaults to the working tree's repository (its origin). Where the board lookup starts, and the owner of a bare board number. | |
| type | No | The field's type; a field of that name with another type is invalid_argument. Required unless issue_field is true, where it only checks the issue field's type. | |
| owner | No | A user or organization login, or "@me": the owner of a numbered board, else the only owner searched for a title. | |
| options | No | single_select only, not with issue_field: Name, Name:COLOR or Name:COLOR:Description (the description is everything after the second colon). COLOR is one of GRAY, BLUE, GREEN, YELLOW, ORANGE, RED, PINK, PURPLE, in any case; the default is GRAY. | |
| project | No | The board, as its number, owner/number or its URL (used as it is; a bare number takes owner, else the owner of repo or of the working tree's repository), or as its title, looked up among open boards (whole title, case-insensitive). Default: the title Roadmap. | |
| issue_field | No | Add a column that mirrors the organization's issue field of that name instead of a field of the board's own; its options and values are the organization's and the issue's. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| field | Yes | The field as it is now, with its options in order. | |
| created | Yes | Whether this call made the field. | |
| project | Yes | ||
| added_options | Yes | The names of the options this call added; [] when none. |