Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

Automates conversion of .changeset/*.md files to CHANGELOG.md entries via PR.

Implementation

New workflow: .github/workflows/changelog-from-changesets.md

  • Engine: Claude 3.7 Sonnet
  • Triggers: Weekly schedule + manual dispatch
  • Execution:
    1. Detects pending changesets in .changeset/
    2. Runs node scripts/changeset.js release --yes to update CHANGELOG.md
    3. Extracts version and bump type from updated changelog
    4. Creates PR via safe-outputs with version details and changelog excerpt

Safe-outputs config:

safe-outputs:
  create-pull-request:
    title-prefix: "chore: "
    labels: [automation, changelog]
    draft: false

Tools enabled: bash, edit, github MCP (repos, pull_requests)

Reuses existing changeset.js script logic—no duplicate version bump calculations or changelog formatting. The script handles git operations internally; workflow ignores push failures and delegates PR creation to safe-outputs.

Original prompt

Create an agentic workflow that:

Convert .changeset/*.md files into the CHANGELOG.md notes (see changesets.js script)

Using the latest release information and produces a PR. Use Claude.

Custom agent used: agentic-workflows
GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update CHANGELOG.md with notes from changeset files Add changelog-from-changesets agentic workflow Feb 3, 2026
Copilot AI requested a review from pelikhan February 3, 2026 12:37
@pelikhan pelikhan marked this pull request as ready for review February 3, 2026 12:40
Copilot AI review requested due to automatic review settings February 3, 2026 12:40
@pelikhan pelikhan merged commit 4b55971 into main Feb 3, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/update-changelog-from-changesets branch February 3, 2026 12:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new agentic workflow that converts pending .changeset/*.md files into CHANGELOG.md updates and opens an automated PR with the results.

Changes:

  • Added new workflow definition for “Changelog from Changesets” (Claude) with safe-outputs PR creation config.
  • Added compiled lock workflow for GitHub Actions execution.
  • Registered the new workflow in the agent-factory status documentation table.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
docs/src/content/docs/agent-factory-status.mdx Adds the new workflow to the published status list.
.github/workflows/changelog-from-changesets.md Defines the agent instructions, including changeset detection, changelog generation, and PR creation.
.github/workflows/changelog-from-changesets.lock.yml Compiled GitHub Actions workflow generated from the markdown definition.
Comments suppressed due to low confidence (1)

.github/workflows/changelog-from-changesets.md:222

  • The create_pull_request example includes fields that are not part of the safe-outputs tool schema here (base, draft). With additionalProperties: false in the tool schema, including these will cause the tool call to be rejected. Remove unsupported fields and rely on the safe-outputs handler config for base branch/draft behavior.
Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`,
  base: "main",
  draft: false
})

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +190 to +191
```javascript
create_pull_request({
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The create_pull_request example omits the branch parameter. In the compiled workflow, safe-outputs validation requires branch for create_pull_request payloads, so the tool call will fail without it. Update the instructions/example to always provide a deterministic branch name (e.g., derived from ${next_version} + date).

Suggested change
```javascript
create_pull_request({
```javascript
const branch = `chore/changelog-${next_version}-${new Date().toISOString().slice(0, 10)}`;
create_pull_request({
branch,

Copilot uses AI. Check for mistakes.
Comment on lines +71 to +76
current_tag=$(git tag -l | tail -1)
echo "Current version: $current_tag"

# Export for the changeset script
export GH_AW_CURRENT_VERSION="$current_tag"
```
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current_tag=$(git tag -l | tail -1) does not reliably pick the latest version tag (tag listing is not guaranteed to be sorted by version or creation date). This can cause incorrect GH_AW_CURRENT_VERSION and downstream version/bump calculations. Use the same approach as scripts/changeset.js (git describe --tags --abbrev=0) or explicitly sort tags by semver / creatordate before selecting.

Copilot uses AI. Check for mistakes.
Comment on lines +106 to +112
# Temporarily create a main branch if we're not on it
current_branch=$(git branch --show-current)
if [ "$current_branch" != "main" ]; then
echo "Not on main branch, creating temporary main for script compatibility"
git checkout -b main 2>/dev/null || git checkout main
fi

Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow hard-codes main by creating/checking out a local main branch for script compatibility. If the repo default branch differs or the workflow is dispatched from a non-default ref, this can generate changelog entries from the wrong commit and/or fail git operations in unexpected ways. Prefer checking out the actual default branch (e.g., ${{ github.event.repository.default_branch }}) and fail/noop when not on it, rather than creating a new local main branch.

Copilot uses AI. Check for mistakes.
Comment on lines +155 to +156
# Count how many changesets were processed
processed_count=$(git diff --stat .changeset/ | grep -c "delete" || echo "0")
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

processed_count is computed via git diff --stat .changeset/ | grep -c "delete", but git diff --stat output typically does not contain the string "delete" even when files are removed, so this will usually report 0. Use git diff --name-status -- .changeset | grep '^D' | wc -l (or similar) to count deletions reliably.

Suggested change
# Count how many changesets were processed
processed_count=$(git diff --stat .changeset/ | grep -c "delete" || echo "0")
# Count how many changesets were processed (deleted from .changeset/)
processed_count=$(git diff --name-status -- .changeset | grep '^D' | wc -l || echo "0")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants