Skip to content

Enhancement: get the allow_forking flag value for a GHRepository #1588

@zemunk

Description

@zemunk

I'd like to contribute a small enhancement to the GHRepository class and add a method to get the value of the allow_forking flag.

From the GitHub REST API Docs:

allow_forking boolean
Either true to allow private forks, or false to prevent private forks.
Default: false

Example context:
I need to fork repositories in a multistep workflow, but for private and internal repos forking can be disabled.
In these cases instead of getting an exception when trying to fork, I'd like to be able to check at the very beginning if it is possible at all and provide a proper message to the users.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions