github-community-projects / github-community-projects/safe-settings

Add support for repository `has_discussions`

Open
#797 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
921
Forks
226
Avg merge
18h 3m
Merged PRs (30d)
14

Description

## Prerequisites:

* Is the functionality available in the GitHub UI? If so, please provide a link to information about the feature.

The GitHub UI settings allows you toggle features including: Wikis, Issues, Discussions, and Projects.

![Image](https://github.com/user-attachments/assets/d14a1ef3-0b86-4b7b-908d-982a9aaf4622)

* Is the functionality available through the GitHub API? If the functionality is available, please provide links to the
API documentation (https://developer.github.com/v3/) as well as the Octokit documentation (https://octokit.github.io/).

The [Create an organization repository](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-an-organization-repository) endpoint has fields for `has_issues`, `has_projects`, `has_wiki`, and `has_downloads` but does not have a `has_discussions` field. However, [Create a repository for the authenticated user](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-for-the-authenticated-user) does.

`has_discussions` is returned from the [Get a repository](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#get-a-repository) endpoint.

* If the functionality is not yet available in the API, it would be helpful if you
contacted support (https://support.github.com/) or posted in the Community Forum (https://github.community/). Please
include a link to the forum post if you create one or a copy of the response from support.

## New Feature

Please describe the desired new functionality:

It would be nice if Discussions could be programmatically enabled/disabled [in the `repository` settings, similar to `has_issues`, `has_projects`, and `has_wiki`](https://github.com/github/safe-settings/blob/28b3dfd7af72e14f0703b341668140ed577e80de/schema/dereferenced/settings.json#L82-L96).

It isn't immediately obvious to me whether Discussions are supported in the API, similar to the aforementioned options. Perhaps this is a known limitation and my attempts to search for previous issues failed me?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.