Skip to main content

Auto Release Notes

· 4 min read


This script generates release notes for a given release version of a solution in Azure DevOps. It retrieves work items from Azure DevOps, summarizes them using GPT, and outputs the release notes in Markdown and HTML formats.


You will need a PAID Open AI API key to run the script, support for other methods will come in future releases

Run as Azure DevOps Pipeline

  1. Copy the Auto-Release-Notes.yml file from the pipelines directory of this repo

  2. Add it to the DevOps Repo you wish to run the notes for, it is recommended this is on the main branch of the repo, the trigger is set to run on update of the main branch by default

  3. Create a new pipeline in Azure DevOps

  4. Select "Azure Repos Git"

  5. Select your Repo

  6. Select "Existing Azure Pipelines YAML file"

  7. Select the "/Auto-Release-Notes.yml" file, this will vary depending on where you stored the file in the repo

  8. Select "Continue"

  9. Select "Variables" > "New Variable"

    • Name: "Model API Key"
    • Value: <YOUR OPENAI API KEY>
    • Keep this value secret: True
    • Let users override this value when running this pipeline: True
  10. Select "OK"

  11. Adjust the remaining variables in the YAML (lines 10-20):

    # The Organisation Name of the Azure DevOps organisation to use i.e. "contoso" from ""
    # The plain text name of the project to use (not the url encoded version) i.e. "My Project" from ""
    # The name of the solution. This will appear as part of the title of the notes document
    # The query id for the release notes query setup in Azure DevOps as a GUID i.e. "f5b6e2af-8f0c-4f6c-9a8b-3f3f2b7e0c1e" from ""
    # Describe the software or project that these release notes are for, this provides context to GPT and the notes being written
    # The API key for the GPT service (stored as a secret) DO NOT MODIFY THE BELOW OR ENTER YOUR API KEY HERE.
    MODEL_API_KEY: $(Model API Key)
  12. Hit "Save" or "Save and Run"

  13. The pipeline will now run whenever the main branch is updated

Run the Script Locally


  • Python 3.7+
  • Azure DevOps Personal Access Token (PAT)
  • OpenAI API Key
  • Node.js and npm (for optional markdownlint-cli installation)


Automated Setup

Unix-based Systems

To automate the setup of the repository on Unix-based systems, run the script. This script will install the required Python packages, install markdownlint-cli, and create a .env file with blank values if it does not exist.

chmod +x

To automate the setup of the repository on Windows, run the setup.ps1 PowerShell script. This script will install the required Python packages, install markdownlint-cli, and create a .env file with blank values if it does not exist.


Manual Setup

If you prefer to set up the environment manually, follow these steps:

  1. Install the required Python packages:
pip install -r requirements.txt
  1. Install markdownlint-cli using npm:
npm install -g markdownlint-cli
  1. Create a .env file in the root directory of the project to store your secrets. This file should contain the following variables:
# Azure DevOps and OpenAI Configuration

If the .env file does not exist, it will be generated with blank values on the first load.

Running the Script

To run the script, execute the following command in your terminal:


The script will generate the release notes in the specified output folder in both Markdown and HTML formats.

Optional: Markdown Linting

If you wish to lint and format the generated Markdown file, you can run the following command:

markdownlint ./Releases/*.md

Customizing Prompts

You can customize the GPT prompts by editing SUMMARY_PROMPT and ITEM_PROMPT in the file.


The script uses Python's logging module to provide detailed logs of its execution. You can adjust the logging level in by modifying the setup_logs function call.


If you have any suggestions or improvements, feel free to create a pull request or open an issue.


This project is licensed under the MIT License.