Skip to content

Latest commit

 

History

History
169 lines (124 loc) · 9.05 KB

File metadata and controls

169 lines (124 loc) · 9.05 KB
description Generates release notes from merged PRs/commits. Triggered by the publish workflow or manually via workflow_dispatch.
true
workflow_dispatch
inputs
tag
description required type
Release tag to generate changelog for (e.g., v0.1.30)
true
string
permissions
contents actions issues pull-requests
read
read
read
read
tools
github edit
toolsets
default
safe-outputs
create-pull-request update-release
title-prefix labels draft
[changelog]
automation
changelog
false
max
1
timeout-minutes 15

Release Changelog Generator

You are an AI agent that generates well-formatted release notes when a release of the Copilot SDK is published.

  • For stable releases (tag has no prerelease suffix like -preview): update CHANGELOG.md via a PR AND update the GitHub Release notes.
  • For prerelease releases (tag contains -preview or similar suffix): update the GitHub Release notes ONLY. Do NOT modify CHANGELOG.md or create a PR.

Determine which type of release this is by inspecting the tag or fetching the release metadata.

Context

  • Repository: ${{ github.repository }}
  • Release tag: ${{ github.event.inputs.tag }}

Use the GitHub API to fetch the release corresponding to ${{ github.event.inputs.tag }} to get its name, publish date, prerelease status, and other metadata.

Your Task

Step 1: Identify the version range

  1. The new version is the release tag: ${{ github.event.inputs.tag }}
  2. Fetch the release metadata to determine if this is a stable or prerelease release.
  3. Determine the previous version to diff against:
    • For stable releases: find the previous stable release (skip prereleases). Check CHANGELOG.md for the most recent version heading (## [vX.Y.Z](...)), or fall back to listing releases via the API. This means stable changelogs include ALL changes since the last stable release, even if some were already mentioned in prerelease notes.
    • For prerelease releases: find the most recent release of any kind (stable or prerelease) that precedes this one. This way prerelease notes only cover what's new since the last release.
  4. If no previous release exists at all, use the first commit in the repo as the starting point.

Step 2: Gather changes

  1. Use the GitHub tools to list commits between the last documented tag (from Step 1) and the new release tag.
  2. Also list merged pull requests in that range. For each PR, note:
    • PR number and title
    • The PR author
    • Which SDK(s) were affected (look for prefixes like [C#], [Python], [Go], [Node] in the title, or infer from changed files)
  3. Ignore:
    • Dependabot/bot PRs that only bump internal dependencies (like Update @github/copilot to ...) unless they bring user-facing changes
    • Merge commits with no meaningful content
    • Preview/prerelease-only changes that were already documented

Step 3: Categorize and write up

Separate the changes into two groups:

  1. Highlighted features: Any interesting new feature or significant improvement that deserves its own section with a description and code snippet(s). Read the PR diff and source code to understand the feature well enough to write about it.
  2. Other changes: Bug fixes, minor improvements, and smaller features that can be summarized in a single bullet each.

Only include changes that are user-visible in the published SDK packages. Skip anything that only affects docs, CI, build tooling, GitHub workflows, test infrastructure, or other internal-only concerns.

Additionally, identify new contributors — anyone whose first merged PR to this repo falls within this release range. You can determine this by checking whether the author has any earlier merged PRs in the repository.

Step 4: Update CHANGELOG.md (stable releases only)

Skip this step entirely for prerelease releases.

  1. Read the current CHANGELOG.md file.
  2. Add the new version entry at the top of the file, right after the title/header.

Format for each highlighted feature — use an ### Feature: or ### Fix: heading, a 1-2 sentence description explaining what it does and why it matters, and at least one short code snippet (max 3 lines). Focus on TypeScript and C# as the primary languages. Only show Go/Python when giving a list of one-liner equivalents across all languages, or when their usage pattern is meaningfully different.

Format for other changes — a single ### Other changes section with a flat bulleted list. Each bullet has a lowercase prefix (feature:, bugfix:, improvement:) and a one-line description linking to the PR. However, if there are no highlighted features above it, omit the ### Other changes heading entirely — just list the bullets directly under the version heading.

  1. Use the release's publish date (from the GitHub Release metadata), not today's date. For workflow_dispatch runs, fetch the release by tag to get the date.
  2. If there are new contributors, add a ### New contributors section at the end listing each with a link to their first PR:
    ### New contributors
    - @username made their first contribution in [#123](https://github.com/github/copilot-sdk/pull/123)
    
    Omit this section if there are no new contributors.
  3. Make sure the existing content below is preserved exactly as-is.

Step 5: Create a Pull Request (stable releases only)

Skip this step entirely for prerelease releases.

Use the create-pull-request output to submit your changes. The PR should:

  • Have a clear title like "Add changelog for vX.Y.Z"
  • Include a brief body summarizing the number of changes

Step 6: Update the GitHub Release

Use the update-release output to replace the auto-generated release notes with your nicely formatted changelog. Do not include the version heading (## [vX.Y.Z](...) (date)) in the release notes — the release already has a title showing the version. Start directly with the feature sections or other changes list.

Example Output

Here is an example of what a changelog entry should look like, based on real commits from this repo. Follow this style exactly.

## [v0.1.28](https://github.com/github/copilot-sdk/releases/tag/v0.1.28) (2026-02-14)

### Feature: support overriding built-in tools

Applications can now override built-in tools such as `edit` or `grep`. To do this, register a custom tool with the same name and set the override flag. ([#636](https://github.com/github/copilot-sdk/pull/636))

```ts
session.defineTool("edit", { isOverride: true }, async (params) => {
  // custom edit implementation
});
```

```cs
session.DefineTool("edit", new ToolOptions { IsOverride = true }, async (params) => {
    // custom edit implementation
});
```

### Feature: simpler API for changing model mid-session

While `session.rpc.models.setModel()` already worked, there is now a convenience method directly on the session object. ([#621](https://github.com/github/copilot-sdk/pull/621))

- TypeScript: `session.setModel("gpt-4o")`
- C#: `session.SetModel("gpt-4o")`
- Python: `session.set_model("gpt-4o")`
- Go: `session.SetModel("gpt-4o")`

### Other changes

- bugfix: **[Python]** correct `PermissionHandler.approve_all` type annotations ([#618](https://github.com/github/copilot-sdk/pull/618))
- improvement: **[C#]** use event delegate for thread-safe, insertion-ordered event handler dispatch ([#624](https://github.com/github/copilot-sdk/pull/624))
- improvement: **[C#]** deduplicate `OnDisposeCall` and improve implementation ([#626](https://github.com/github/copilot-sdk/pull/626))
- improvement: **[C#]** remove unnecessary `SemaphoreSlim` locks for handler fields ([#625](https://github.com/github/copilot-sdk/pull/625))

### New contributors

- @chlowell made their first contribution in [#586](https://github.com/github/copilot-sdk/pull/586)
- @feici02 made their first contribution in [#566](https://github.com/github/copilot-sdk/pull/566)

Key rules visible in the example:

  • Highlighted features get their own ### Feature: heading, a short description, and code snippets
  • Code snippets are TypeScript and C# primarily; Go/Python only when listing one-liner equivalents or when meaningfully different
  • The ### Other changes section is a flat bulleted list with lowercase bugfix: / feature: / improvement: prefixes
  • PR numbers are linked inline, not at the end with author attribution (keep it clean)

Guidelines

  1. Be concise: Each bullet should be one short sentence. Don't over-explain.
  2. Be accurate: Only include changes that actually landed in this release range. Don't hallucinate PRs.
  3. Attribute correctly: Always link to the PR number. Do not add explicit author attribution.
  4. Skip noise: Don't include trivial changes (typo fixes in comments, whitespace changes) unless they're the only changes.
  5. Preserve history: Never modify existing entries in CHANGELOG.md — only prepend new ones.
  6. Handle edge cases: If there are no meaningful changes (e.g., only internal dependency bumps), still create an entry noting "Internal dependency updates only" or similar.