Hi there,
We’d like to push build information for a package along with every release that’s created by our CI/CD system (CircleCI).
The build information should contain all the commits since the previous release, so that those commits can be included in the release note.
For example:
{
"BuildUrl": "https://circleci.com/gh/OurOrg/OurRepo/12345",
"BuildNumber": "12345",
"Commits": [
{
"Comment": "[Developer 1] Making a change",
"Id": "2bf2153a"
},
{
"Comment": "[Developer 2] Making another change",
"Id": "95f21cc3"
}
],
"VcsType": "Git",
"VcsRoot": "git@github.com:OurOrg/OurRepo.git",
"Branch": "main",
"VcsCommitNumber": "95f21cc3",
"BuildEnvironment": "CircleCI"
}
In order to generate the list of commits in this example, we need the VcsCommitNumber
of the package in the previous release. Once we have that hash, we can easly fetch all the commit since then…
git log $vcsCommitNumber..HEAD
… and generate the Commits
array in the JSON from that.
Getting release info via …
octo list-releases --server=$ourServer --apiKey=$apiKey --project=$project --outputFormat=Json
… is not sufficient, as it does not return build information of the package.
The CLI does not appear to have a get-build-information
(or similar) command.
What is the recommended way to fetch the build information from the most recent release?
Any other guidance on how to produce the list of commits when pushing build information?
Thanks!
Max