agentleFS
reaatechreaatech/mcp-changelog/skills/github-action/SKILL.md

github-action

Skill0 starsChanged 3 months agoMITView on GitHub

The GitHub Action skill provides capabilities for integrating mcp-changelog into GitHub workflows. It automatically detects schema changes in pull requests and posts comments with changelog information.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Update existing comments on new pushes

    line 11
  2. Distinctive:

    Write changelog files as workflow artifacts

    line 16

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

GitHub Action Skill

Purpose

The GitHub Action skill provides capabilities for integrating mcp-changelog into GitHub workflows. It automatically detects schema changes in pull requests and posts comments with changelog information.

Capabilities

1. PR Commenting

  • Post schema change summaries as PR comments
  • Update existing comments on new pushes
  • Support minimal permissions (read contents, write PR comments)
  • Fail gracefully with clear error messages

2. File Output

  • Write changelog files as workflow artifacts
  • Support both comment-on-PR and file-output modes
  • Generate files for downstream workflow steps

3. Breaking Change Detection

  • Optionally fail the workflow on breaking changes
  • Support acknowledgment files for approved breaking changes
  • Provide status checks for PR validation

Usage Examples

Basic PR Commenting

# .github/workflows/schema-changelog.yml
name: Schema Changelog

on:
  pull_request:
    branches: [main]

jobs:
  changelog:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write

    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - uses: reatech/mcp-changelog@v1
        with:
          comment-on-pr: true

With Custom Schema Path

- uses: reatech/mcp-changelog@v1
  with:
    schema-path: 'api/schema.json'
    comment-on-pr: true

Fail on Breaking Changes

- uses: reatech/mcp-changelog@v1
  with:
    fail-on-breaking: true
    acknowledgment-file: '.schema-breaking-allowed'

File Output Mode

- uses: reatech/mcp-changelog@v1
  with:
    comment-on-pr: false
    output-dir: './changelog'

- name: Upload changelog artifacts
  uses: actions/upload-artifact@v4
  with:
    name: changelog
    path: ./changelog/

With Release Workflow

name: Release

on:
  push:
    tags:
      - 'v*'

jobs:
  changelog:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Generate changelog
        uses: reatech/mcp-changelog@v1
        with:
          output-dir: './changelog'
          format: 'markdown,json'

      - name: Create Release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.ref }}
          release_name: Release ${{ github.ref }}
          body_path: ./changelog/CHANGELOG.md

Action Inputs

InputDescriptionDefault
schema-pathPath to schema file (auto-detected if omitted)''
base-refBase git ref for comparisongithub.event.pull_request.base.sha
head-refHead git ref for comparisongithub.event.pull_request.head.sha
comment-on-prPost comment on PRtrue
fail-on-breakingFail workflow on breaking changesfalse
acknowledgment-fileFile that acknowledges breaking changes''
output-dirDirectory for output files''
formatOutput format (markdown, json, all)all
configPath to config file''

PR Comment Format

## Schema Changes Detected

| Change | Tool | Severity |
|---|---|---|
| Field renamed: `name` → `full_name` | `createUser` | 🔴 High |
| Required field added: `age` | `createUser` | 🔴 High |
| New tool added | `getUser` | 🟢 None |

**Suggested version bump**: `major`

<details>
<summary>Full changelog (5 changes)</summary>

### 🔥 Breaking Changes
- **createUser**: Field `name` renamed to `full_name`
- **createUser**: Required field `age` added without default

### ✨ Added
- **createUser**: Optional field `middle_name` added
- **getUser**: New tool for fetching user details

### 🐛 Fixed
- **getUser**: Pagination limit increased to 1000

</details>

---
*Generated by [mcp-changelog](https://github.com/reaatech/mcp-changelog)*

Implementation

// action/src/main.ts
import * as core from '@actions/core';
import * as github from '@actions/github';
import { detectChanges } from '@mcp-schema-evolution/core';
import { generateChangelog } from '@reaatech/mcp-changelog/changelog';
import { formatComment } from './comment';

async function run() {
  const schemaPath = core.getInput('schema-path');
  const baseRef = core.getInput('base-ref') || github.context.payload.pull_request?.base?.sha;
  const headRef = core.getInput('head-ref') || github.context.payload.pull_request?.head?.sha;
  const commentOnPR = core.getBooleanInput('comment-on-pr');
  const failOnBreaking = core.getBooleanInput('fail-on-breaking');
  const acknowledgmentFile = core.getInput('acknowledgment-file');
  const outputDir = core.getInput('output-dir');

  if (!baseRef || !headRef) {
    core.setFailed('Could not determine base and head refs');
    return;
  }

  try {
    // Detect changes
    const changes = await detectChanges({ baseRef, headRef, schemaPath });

    // Generate changelog
    const changelog = await generateChangelog({ changes });

    // Check for breaking changes
    if (failOnBreaking && changelog.hasBreaking) {
      if (acknowledgmentFile) {
        const acknowledged = await checkAcknowledgment(acknowledgmentFile);
        if (!acknowledged) {
          core.setFailed('Breaking changes detected. Add acknowledgment file to allow.');
          return;
        }
      } else {
        core.setFailed('Breaking changes detected');
        return;
      }
    }

    // Post PR comment
    if (commentOnPR && github.context.payload.pull_request) {
      await postPRComment(changes, changelog);
    }

    // Write output files
    if (outputDir) {
      await writeOutputFiles(changelog, outputDir);
    }

    core.setOutput('has-breaking', changelog.hasBreaking);
    core.setOutput('suggested-bump', changelog.suggestedVersionBump);

  } catch (error) {
    core.setFailed(error.message);
  }
}

async function postPRComment(changes: SchemaChange[], changelog: ChangelogOutput) {
  const octokit = github.getOctokit(process.env.GITHUB_TOKEN!);
  const { owner, repo, number } = github.context.issue;

  // Find and delete existing comment
  const comments = await octokit.rest.issues.listComments({ owner, repo, issue_number: number });
  const existing = comments.data.find(c => c.body?.includes('Generated by [mcp-changelog]'));
  if (existing) {
    await octokit.rest.issues.deleteComment({ owner, repo, comment_id: existing.id });
  }

  // Post new comment
  const body = formatComment(changes, changelog);
  await octokit.rest.issues.createComment({ owner, repo, issue_number: number, body });
}

run();

action.yml

name: 'MCP Changelog'
description: 'Generate changelogs for MCP schema changes'
author: 'reaatech'

inputs:
  schema-path:
    description: 'Path to schema file (auto-detected if omitted)'
    required: false
  base-ref:
    description: 'Base git ref for comparison'
    required: false
  head-ref:
    description: 'Head git ref for comparison'
    required: false
  comment-on-pr:
    description: 'Post comment on PR'
    required: false
    default: 'true'
  fail-on-breaking:
    description: 'Fail workflow on breaking changes'
    required: false
    default: 'false'
  acknowledgment-file:
    description: 'File that acknowledges breaking changes'
    required: false
  output-dir:
    description: 'Directory for output files'
    required: false
  format:
    description: 'Output format (markdown, json, all)'
    required: false
    default: 'all'
  config:
    description: 'Path to config file'
    required: false

outputs:
  has-breaking:
    description: 'Whether breaking changes were detected'
  suggested-bump:
    description: 'Suggested version bump (major, minor, patch)'

runs:
  using: 'node20'
  main: 'action/dist/index.js'

branding:
  icon: 'file-text'
  color: 'blue'

Best Practices

1. Minimal Permissions

# Good: Minimal permissions
permissions:
  contents: read
  pull-requests: write

# Bad: Overly permissive
permissions: write-all

2. Graceful Failure

// Good: Clear error messages
if (!baseRef || !headRef) {
  core.setFailed('Could not determine base and head refs. Are you running on a PR?');
}

// Bad: Generic errors
if (!baseRef) {
  core.setFailed('Error');
}

3. Idempotent Comments

// Good: Update existing comment
const existing = comments.data.find(c => c.body?.includes('mcp-changelog'));
if (existing) {
  await octokit.rest.issues.updateComment({ comment_id: existing.id, body });
} else {
  await octokit.rest.issues.createComment({ body });
}

// Bad: Duplicate comments on every push
await octokit.rest.issues.createComment({ body });

Testing Strategies

describe('GitHub Action', () => {
  it('should post comment on PR', async () => {
    const mockOctokit = createMockOctokit();
    const result = await runAction({
      eventName: 'pull_request',
      payload: { pull_request: { number: 123 } },
      octokit: mockOctokit
    });

    expect(mockOctokit.issues.createComment).toHaveBeenCalledWith(
      expect.objectContaining({ issue_number: 123 })
    );
  });

  it('should fail on breaking changes when configured', async () => {
    const result = await runAction({
      inputs: { 'fail-on-breaking': 'true' },
      changes: [{ type: 'breaking' }]
    });

    expect(result.failed).toBe(true);
    expect(result.error).toContain('Breaking changes detected');
  });

  it('should pass with acknowledgment file', async () => {
    const result = await runAction({
      inputs: { 'fail-on-breaking': 'true', 'acknowledgment-file': '.breaking-allowed' },
      fileExists: true,
      changes: [{ type: 'breaking' }]
    });

    expect(result.failed).toBe(false);
  });
});

Resources

  • ARCHITECTURE.md - System architecture
  • GitHub Action section - Detailed module spec
  • GitHub Action Toolkit - Action development library

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.