This demo showcases how to use Inferable workflows to create an automated changelog generator. The workflow analyzes git commits, summarizes changes, and automatically generates and updates a changelog while also integrating with Zapier for notifications.
This is also how we generate the changelog for Inferable.
- Automatically tracks and processes new commits since the last run
- Intelligently categorizes changes into fixes, features, and other types
- Generates human-readable changelog entries
- Integrates with Zapier for automated notifications
- Maintains a persistent changelog file
- Supports SDK-specific change tracking
-
getCommitInfo
- Gets detailed information about specific commits
- Returns commit message, title, description, and changed files
- Provides concise information for quick analysis
-
getCommitDiff
- Retrieves the full diff for specific commits
- Used sparingly due to potentially large response size
- Provides detailed context when needed
-
summarizeCommit
Agent- Analyzes individual commits
- Categorizes changes (fix/feature/other)
- Extracts commit dates and descriptions
- Uses AI to understand commit context
-
summarizeCommits
Agent- Generates overall changelog summaries
- Focuses on significant changes
- Tracks SDK-specific changes
- Determines version bumps for SDK releases
graph TD
A[Start Workflow] --> B[Get New Commits]
B --> C[Read Last Commit Hash]
C --> D[Process New Commits]
D --> E{For Each Commit}
E --> F[Get Commit Info]
F --> G[Get Commit Diff if needed]
G --> H[Summarize Commit]
H --> E
E --> I[Generate Overall Summary]
I --> J[Format Changelog]
J --> K[Update CHANGELOG.md]
K --> L[Update Last Commit Hash]
L --> M[Send to Zapier]
M --> N[End Workflow]
-
Environment Variables:
INFERABLE_API_SECRET
: Your Inferable API keyZAPIER_WEBHOOK_URL
: Webhook URL for Zapier integration
-
File Structure:
- Maintains
last-commit-hash.txt
for tracking processed commits - Updates
CHANGELOG.md
in the project root
- Maintains
The workflow can be triggered using:
inferable.workflows.trigger("summarize", {
executionId: crypto.randomUUID(),
});
The generated changelog entries follow this structure:
- Overall summary of changes
- Categorized list of changes:
- Bug fixes
- New features
- SDK releases
- Other changes
- Each entry includes:
- Change type
- Description
- Date of change
The changelog is automatically prepended to the existing CHANGELOG.md file, maintaining a historical record of all changes.
The following are some example changelog entries generated by this workflow:
-
CHANGELOG.md: The project maintains a detailed changelog file that is automatically generated using this workflow.
-
Twitter Updates: Follow @inferablehq on Twitter/X for real-time updates, announcements, and tips about new features and improvements.