Github Actions v4 API? - github

I need to interact with Github Actions through some code. I found the v3 API for that, but I've been migrating code to use the v4 API instead. I have not been able to find anything related to github actions on v4, unfortunately. Using introspection won't show "artifacts" or "workflows", except for copying the latter on CloneProjectInput, but, perhaps, there's a feature flag I need to use to get them.
Is there any way to interact with Github Actions through their v4 API?

Not yet: the GitHub Actions API announced last January 2020 is:
still in beta
using the V3 API only
Note that there is a difference between:
GitHub REST API v3
GitHub GraphQL API v4
For now, Actions are exposed through REST, not GraphQL
The request has been made of course:
As of now, the GitHub Actions API enables you to manage GitHub Actions only using the REST API.
I'll be sure to pass on your request for v4 support to the team for consideration.
(that was mid-April 2020)

Related

Is it possible to fetch the issue/PR templates of a Github repository, via REST API?

I wanted to pre-fill some Github issue/PR creation forms, by fetching the templates from the repository via REST API.
Is this possible? I've searched in the documentation, but I couldn't find an API for this purpose.

When should you not use GitHub GraphQL API?

Much has been written about the benefits of the GitHub GraphQL API. And this is a really great technology. The only thing I can't figure out is in what situations is it still better to use the good old REST API v3?
Github GraphQL API is subject to the following caveats:
GraphQL API can only be accessed using authentication. You need a token to use this API. Thus, you can't use GraphQL in an environment where you can't secure the provisioning of this token. For example, in a web app without github authentication. This is a big caveat, especially for people who want to create web app or scripts that target only public repository informations.
Searching commits and code using the search API is not possible in Github Graphql. Only searching repos, issues and users are supported (for the search API)
some features like comparing commits and getting contributors are not possible yet in Graphql. Another example: you can't recursively get a tree using GraphQL API
some mutations already available in v3 may not yet have been implemented in GraphQL (create commit, create tag, create branch etc...), checkout mutations documentation

does github's GraphQL API deprecate the rest api?

I'm starting a brand new project (aka no legacy code) that will interact with github, and there's currently 2 supported APIs, the "rest" API is called "API V3" and the "GraphQL" API is called "API V4",
question is then, does the V4 API deprecate the V3 API? Should I strive to use the V4 API even if I think the V3 API seems easier to use? or should I just pick the API that seems like the best fit regardless of the API version number?
There are two stable versions of the GitHub API: the REST API v3 and the GraphQL API v4.
Looking at the https://developer.github.com/v3/versions/ - it is not. Only V1 and V2 are listed in the "deprecated" section - both are already dead since 2012.

VSTS Release API Documentation

In the following post uses the VSTS release API to get all the work items associated with a release: VSTS find workitems between two releases
It uses the following call:
https://{account}.vsrm.visualstudio.com/[teamproject]/_apis/Release/releases/{current release id}/workitems?api-version=4.1-preview.1&baseReleaseId={compare release id}
workitems isn't listed in the VSTS API documentation: https://learn.microsoft.com/en-us/rest/api/vsts/release/releases/get%20release?view=vsts-rest-4.1
Is there a more complete list available that I simply can't find? Is it possible to get the list of commits similar to:
Most of the REST APIs are documented here : Visual Studio Team Services REST API Reference
However some related REST APIs are not documented. For these REST APIs we can use tools such as Fiddler or directly press F12 - network in Chrome to track them.
Based on my test, no such a REST API can directly retrieve the compared commits from Release. Actually the different commits are retrieved by several REST APIs, get information from corresponding changesets then compare them...
So, if you want to get the different commits with REST API, you need to retrieve the changeset ID from previous release and the changeset ID in current release. then compare them.
e.g:
POST : https://{account}.visualstudio.com/{project}/_api/_versioncontrol/history?api-version=5.0-preview.1
Request Body:
{"repositoryId":"","searchCriteria":"{\"itemPaths\":[\"$/0522TFVCScrum/PS\"],\"fromVersion\":\"180\",\"toVersion\":\"183\",\"top\":50}"}

Get Pipeline Value of GitHub Issues?

I use ZenHub to manage my Issues on GitHub.
When I go to the detail of an issue I can see the property "pipeline" in GitHub which is exactly the column where the Issue is saved.
Now I want to get the pipeline information out of my issues using the API of GitHub. But none of the Issue-Methods
GET /repos/:owner/:repo/issues or GET /repos/:owner/:repo/issues/:number seem to have any information about the pipeline. Is it hidden anywhere else?
Pipeline is purely a ZenHub feature.
As such, it is not exposed in the Github API Issues (or in any other GitHub API)
A ZenHub public API is in the making (issue 172).
Update: The API is available: ZenHub API
With the Github API v4, you can query the combinedContexts of a commit to retrieve a list of status contexts and check runs for the commit triggering your pipelines.