Programmatically enable GitHub Discussions for a repository - github

Is there a way to enable GitHub Discussions for a repository using the GitHub API? The only way to enable discussions that I could find is manually through the Settings page.

GitHub recently released the Discussions GraphQL API. The documentation for the API is available here.

With the GitHub CLI gh v2.22.0 (Jan. 2023), you can do so using gh repo edit --enable-discussions[=false]:
It enables/disables the discussion on your remote GitHub repository right from command-line.
That way, you don't have to directly manipulate the GH API: the API call is done for you through the API.

Related

Templates & Resources for creating documentation using Azure DevOps Wiki

Working on a relatively new team in a much larger organization, and as a side project I am looking at our current documentation for opportunities to improve/standardize our best practices/standards. The ideal tool we would like to use, if up to the task, is Azure DevOps Wiki (this is AZDO Service, not Server) since it lines up with the rest of our PM functions. I was doing some digging, and I have not found much in the way of resources/templates/guides that can really get you going for Azure DevOps Wiki.
Beyond general documentation best practices, is there any helpful tricks/resources that we can use to make the most out of that particular tool? Or is there just a better tool we should consider? Looking for ideas! Any feedback is appreciated.
What I am looking for is a library of templates/resources that could
be used to help standardize documentation.
Official doesn't provided any template or resources for standard. There has been a feature request here:
Make it possible to create wiki page based on a template
You can upvote this feature request of Azure DevOps and share your ideas.
But since the DevOps wiki is designed based on Azure DevOps repository, you can clone the template you want to your wiki repository.
The repository url of your wiki should be:
https://dev.azure.com/<Organization Name>/<Project Name>/_git/<Project Name>.wiki
Use this command to clone the wiki repository:
git clone https://<Personal Access Token>#dev.azure.com/<Organization Name>/<Project Name>/_git/<Project Name>.wiki
PS:
Every DevOps project has a hidden repository, which named '<Project Name>.wiki', this repository can't be access via the repository UI list, also can't be listed via the List Repositories REST API. This repository also unable to be managed as other common repositories. Only 'Security for Wiki'. The repository will store all of the information in the pages of wiki permanently unless you delete the file in the repo.
And the comments section of the wiki is implemented quite differently, it is not based on a git repo and does not provide an explicit manage method. If you accidentally delete an image in a comment from the wiki, you won't have any way to get it back.

Is there a cli equivalent of Github cli for Bitbucket?

I'm looking for a Bitbucket tool that is similar to the Github cli. I'm aware of API, but that's not what I'm looking for. This tool is for the Bitbucket cloud version.
i don't think so there is one yet officially. If it's of any use, you could make use of my script https://github.com/psadi/bbcli - it is api based, and its for enterprise.

API for releasing actions to Github Marketplace

Is there an API or a programmatic way to release an action to Github Marketplace? Most actions/APIs are for creating a release in the Repo itself but releasing to marketplace seems like a UI only feature. Does anyone if there's an API or cli method for doing so?
It is true, as mentioned in GitHub Marketplace, that:
Anyone can publish an action in GitHub Marketplace as long as they meet the terms of service. Unlike apps, GitHub Actions listed in GitHub Marketplace are not verified by GitHub.
In that regard, the process could benefit from an API.
But while there is a GitHub Marketplace API, it does not include the publication process itself, which remains a manual process for now.

Jira Issues (User Stories) integrated with GIT Issues (Developer Tasks)

All,
How do you associate a GitHub issue (developer task) to a Jira issue (user story).
And how do you configure Jira to have full visibility into GitHub issue status, and commits?
As background, we currently use Jira Cloud.
JIRA integrates with Atlassian Stash. You can set up integrations to change the status of the JIRA according to things like when a pull request is opened or merged. You will also have links from the JIRA page to see the individual commits. See the JIRA INTEGRATION section on the link.

How to create a new Azure Website with integration to private Github repo using the Azure REST API?

There are many trivial examples that show how this is done without the Github integration. The Azure Powershell commandlet New-AzureWebsite supports only public repos (can be confirmed from source code [1]). Has anyone tried to create it with a connection to a private repo? It doesn't seem to be documented anywhere.
UPDATE: I've realized this might be something Kudu helps me with.
[1] https://github.com/Azure/azure-powershell/blob/e06a22c22f7a1c8153e9c2fa7c159ae7b1fd1dab/src/ServiceManagement/Services/Commands.Utilities/Websites/Services/GithubClient.cs#L124
We have not added the functionality to powershell. However, you could try using the ARMClient tool below to achieve just that. See its readme and wiki for info.
https://github.com/projectkudu/ARMClient
https://github.com/projectkudu/ARMClient/wiki/Setup-GitHub-publishing-to-Site