# GitHub and releases

> **In short.** Optional. Connect a product to a GitHub repo through Junco's GitHub App (issues
> only). **Create issue** on a ticket makes one issue from the whole group of reports, drafted by
> the AI without personal details. Closing it as completed tells users a fix is coming; a GitHub
> release, the Releases page or `POST /v1/releases` from a deploy script tells them it's live.

Connect a product to its GitHub repo to make issues from tickets and to tell users when their fix
is live.

## Connecting

On the product's page, **GitHub → Connect GitHub**:

1. GitHub asks where to install **Junco's app**. Pick the account and the repos it may use. It
   asks only for issues (read and write) and the repo's basic details.
2. You sign in with GitHub, so Junco can check those installations are really yours.
3. Back in Junco, pick the repo for this product.

Only admins can connect GitHub. A repo not in the list? Use **Add it on GitHub** to give the app
access to more repos.

## Issues from tickets

On a ticket (or an idea), **Create issue**. The AI drafts the issue from every report of the same
problem: steps to reproduce, what was expected, the version and device. It never includes users'
personal details. You can edit it before it goes. The issue is labelled `bug` or `idea` and
`from-junco`. Later reports of the same thing add a comment to the issue, not a new one.

When the issue is **closed as completed**, its tickets move to **Awaiting release** and the users
are told the fix is coming in the next update. Closed as not planned, the tickets come back to you
and users aren't told.

## Releases

When the new version is out, its fixed tickets move to **Released** and each user is told. Three
ways, use whichever suits:

- **A GitHub release** (on by default once connected): publishing a release on the repo releases
  every fixed ticket, named after the release's tag. Drafts and pre-releases don't count. Turn it
  off on the product's page.
- **By hand**: the **Releases** page lists everything waiting; pick some or all.
- **From your deploy script**: make a release key on the **Releases** page, then:

```sh
curl -X POST https://desk.juncodesk.app/v1/releases \
  -H "Authorization: Bearer $JUNCO_RELEASE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"version": "1.4.2"}'
```

Add `"issues": [12, 15]` to release only the fixes from those GitHub issues.
