googleapis / googleapis/release-please

Allow linking a GitHub Discussion to the release (discussion_category_name)

Open
#2,843 0 comments 0 reactions 0 assignees View on GitHub
type: feature request
Dominant language
TypeScript
Stars
7.5k
Forks
588
Avg merge
12h 16m
Merged PRs (30d)
7

Description

**Is your feature request related to a problem? Please describe.**

When release-please creates a GitHub Release, I have no way to make it also open a linked GitHub Discussion for that release. GitHub supports this natively — the Releases REST API (both "Create a release" and "Update a release") accepts a `discussion_category_name` field that creates a discussion in the given category and links it to the release. I'd like each release to automatically get an announcement/discussion thread, but release-please never sets that field, so today I can't get it from release-please alone.

**Describe the solution you'd like**

A config option (per package) that release-please passes through as `discussion_category_name` when it creates the GitHub Release. Something like:

```json
{
"packages": {
".": {
"release-type": "go",
"discussion-category": "Announcements"
}
}
}
```

As with the raw API, the category would need to already exist in the repository.

**Describe alternatives you've considered**

I currently do it in a separate workflow that runs on `release: published` and patches the release after release-please creates it:

```yaml
on:
release:
types: [published]
permissions:
contents: write
discussions: write
jobs:
discussion:
runs-on: ubuntu-latest
steps:
- env:
GH_TOKEN: ${{ github.token }}
run: |
gh api --method PATCH \
"repos/${{ github.repository }}/releases/${{ github.event.release.id }}" \
-f discussion_category_name='Announcements'
```

This works (the PATCH creates and links the discussion, and is ignored if one already exists), but it's an extra workflow, and it only fires because I publish releases with a GitHub App token — the default `GITHUB_TOKEN` wouldn't trigger it. Having release-please set the field at release-creation time would be simpler and remove that moving part.

**Additional context**

`discussion_category_name` is documented on both the Create a release and Update a release endpoints in the GitHub REST API. As far as I can tell there's no existing option for this — the config/manifest schemas and the action inputs don't expose anything discussion-related, and `createRelease` doesn't pass the field through — so I don't think it's currently possible without the extra workflow above.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the createRelease entry point and the config/manifest schemas and action inputs, which the issue identifies as the relevant surfaces. Add the per-package discussion-category option and pass it through as discussion_category_name, then verify that an existing repository category produces a linked release discussion.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, typescript
Domain
release
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.