Configuring Release Notes and API Documentation
This lesson explains how to build release notes from existing records, and keep API documentation accurate.
Learning outcomes
After completing this lesson, you will be able to:
- Configure generated release notes on GitHub.
- Describe release notes options in Azure Pipelines.
- Explain code-first and design-first API documentation.
- Explain how a pipeline publishes API documentation.
Release notes
Release notes serve people who will not read a commit log. They should describe changes in terms of what a reader can now do, along with any action a reader must take. Writing them by hand at the end of a release is slow, and it leads to omissions, so both platforms offer ways to build them from existing records.
GitHub generated release notes
A GitHub release is attached to a tag, and it can hold notes and binary assets. GitHub can generate release notes automatically, listing merged pull requests and new contributors since the previous release. A file named .github/release.yml controls the output by defining categories according to pull request labels, and it can exclude items such as those raised by bots.
changelog:
exclude:
labels:
- ignore-for-release
authors:
- dependabot
categories:
- title: Breaking changes
labels: [breaking-change]
- title: New features
labels: [enhancement]
- title: Bug fixes
labels: [bug]
- title: Other changes
labels: ["*"]A workflow can create the release automatically with the GitHub CLI command gh release create v2.3.0 --generate-notes. This approach depends on pull requests being labelled, which a workflow or a branch rule can enforce.
Azure Pipelines and release notes
A pipeline run knows which commits and work items it contains, and these appear on the run summary and in the environment deployment history. The GitHubRelease@1 task creates a release in a GitHub repository from a pipeline, and it can build a changelog from commits and issues. Marketplace extensions can write release notes to a wiki. Whichever route is used, the source data is only as good as the work item titles and commit messages.
The following diagram shows the configuration and the release flow.

Generated notes that miss the mark
API documentation
API documentation has a particular risk: if it drifts from the code, developers build against behaviour that does not exist. The solution is to generate it from the same source as the API, as part of the build.
OpenAPI descriptions
The OpenAPI Specification describes an HTTP API in a JSON or YAML file, including paths, parameters, responses and authentication. There are two approaches to producing one. In a code-first approach, a library such as Swashbuckle for ASP.NET Core reads the code and generates the description during the build. In a design-first approach, the team writes the description, reviews it, and generates server and client code from it.
Publishing in a pipeline
A pipeline can generate the description, publish it as an artifact, and fail the build if a breaking difference is found by comparison with the previous version. Azure API Management can import an OpenAPI description and present it in a developer portal, so that a release updates both the gateway and its documentation. For library code, XML documentation comments with tools such as DocFX generate reference pages, which can be published to GitHub Pages or another static site host.
Keeping API documentation honest
Automating a changelog
A team on GitHub creates releases from a tag. The team wants notes grouped into features and fixes, with Dependabot updates left out, and it does not want to edit the notes by hand. What should you configure?
You should add .github/release.yml, with categories keyed to the pull request labels and an exclusion for the dependabot author, and have a workflow triggered by the tag run gh release create with --generate-notes. The labels must be applied consistently. A manually maintained changelog file conflicts with the stated need, and a workflow that lists all commits would not group changes or leave out Dependabot without additional scripting.
Which file sets the categories in GitHub generated release notes?
Show answer
.github/release.yml. It maps pull request labels to categories, and can exclude labels or authors.
Exam Tips
Remember for the exam
- .github/release.yml groups generated release notes by label.
- gh release create TAG --generate-notes builds notes from merged pull requests.
- Generate API documentation in the build so that it matches the code.
- OpenAPI describes HTTP APIs; API Management can import it.
- GitHubRelease@1 creates a GitHub release from Azure Pipelines.