Add changelog-from-changesets agentic workflow#13471
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
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_requestexample includes fields that are not part of the safe-outputs tool schema here (base,draft). WithadditionalProperties: falsein 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.
| ```javascript | ||
| create_pull_request({ |
There was a problem hiding this comment.
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).
| ```javascript | |
| create_pull_request({ | |
| ```javascript | |
| const branch = `chore/changelog-${next_version}-${new Date().toISOString().slice(0, 10)}`; | |
| create_pull_request({ | |
| branch, |
| current_tag=$(git tag -l | tail -1) | ||
| echo "Current version: $current_tag" | ||
|
|
||
| # Export for the changeset script | ||
| export GH_AW_CURRENT_VERSION="$current_tag" | ||
| ``` |
There was a problem hiding this comment.
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.
| # 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 | ||
|
|
There was a problem hiding this comment.
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.
| # Count how many changesets were processed | ||
| processed_count=$(git diff --stat .changeset/ | grep -c "delete" || echo "0") |
There was a problem hiding this comment.
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.
| # 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") |
Automates conversion of
.changeset/*.mdfiles to CHANGELOG.md entries via PR.Implementation
New workflow:
.github/workflows/changelog-from-changesets.md.changeset/node scripts/changeset.js release --yesto update CHANGELOG.mdSafe-outputs config:
Tools enabled: bash, edit, github MCP (repos, pull_requests)
Reuses existing
changeset.jsscript 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
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.