Skip to content

Add changeset generator workflow for pull requests#1299

Merged
pelikhan merged 5 commits intomainfrom
copilot/add-changeset-workflow
Oct 7, 2025
Merged

Add changeset generator workflow for pull requests#1299
pelikhan merged 5 commits intomainfrom
copilot/add-changeset-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 7, 2025

Summary

This PR adds a GitHub Agentic Workflow that automatically generates changeset files when a pull request becomes ready for review, streamlining the version management process.

Problem

Creating changesets manually for each pull request is:

  • Time-consuming and easy to forget
  • Prone to errors in format and version classification
  • Inconsistent across contributors

Solution

A new workflow (.github/workflows/changeset-generator.md) that:

  1. Triggers automatically when a PR is marked as "ready for review"
  2. Analyzes the PR content using Claude AI to understand the changes
  3. Determines the correct version bump (major/minor/patch) based on:
    • PR title and description keywords (feat:, fix:, BREAKING CHANGE, etc.)
    • Nature of the changes described
  4. Generates a properly formatted changeset following the official changesets specification
  5. Pushes the changeset directly to the current PR branch (commits it to the PR being reviewed)

Example

When a PR titled "feat: Add support for custom themes" is marked ready for review, the workflow will:

  1. Analyze the PR content
  2. Determine it's a new feature → minor version bump
  3. Check package.json for the package name (e.g., "gh-aw")
  4. Create .changeset/minor-add-custom-theme-support.md:
---
"gh-aw": minor
---

Add support for custom themes

This PR adds the ability to configure custom themes for the CLI output.
  1. Commit and push the changeset file directly to the current PR branch

Configuration

  • Engine: Claude AI for intelligent PR analysis
  • Permissions: Minimal required (contents:read, pull-requests:read)
  • Safe Outputs: Uses push-to-pull-request-branch to commit changes directly to the PR
  • Timeout: 10 minutes

Benefits

✅ Automates changeset creation process
✅ Ensures consistent changeset format
✅ Reduces human error in version classification
✅ Integrates seamlessly with changesets tooling
✅ Saves developer time and mental overhead
✅ Changeset becomes part of the same PR (no separate PR needed)

Files Changed

  • .github/workflows/changeset-generator.md - Workflow definition (4.4 KB)
  • .github/workflows/changeset-generator.lock.yml - Compiled GitHub Actions workflow (168 KB)

Testing

  • ✅ Workflow compiles successfully
  • ✅ All unit tests pass
  • make agent-finish validation complete
  • ✅ Uses only allowed GitHub context expressions for security
  • ✅ Code review passed

Resolves the need for automated changeset generation as specified in the issue requirements.

Original prompt

Generate a workflow that generates a changeset from the changes in a pull request when it becomes ready for review.

changeset spec and format: https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits October 7, 2025 12:25
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add workflow to generate changeset on review Add changeset generator workflow for pull requests Oct 7, 2025
Copilot AI requested a review from pelikhan October 7, 2025 12:36
pull-requests: read
engine: claude
safe-outputs:
create-pull-request:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

use push to pull request branch instead

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot use push to pull request branch instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed to use push-to-pull-request-branch in commit b4f7e8b. The workflow now pushes the changeset directly to the PR branch instead of creating a separate PR.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan October 7, 2025 13:12
permissions:
contents: read
pull-requests: read
engine: claude
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot use copilot

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Oct 7, 2025

@copilot merge main, format, lint, recompile

@pelikhan pelikhan merged commit 20ea9e1 into main Oct 7, 2025
10 of 11 checks passed
@pelikhan pelikhan deleted the copilot/add-changeset-workflow branch October 7, 2025 13:52
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