ai-changelog-action 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/FUNDING.yml +1 -0
- package/.github/workflows/ci.yml +22 -0
- package/.prettierignore +3 -0
- package/.prettierrc.json +7 -0
- package/LICENSE +21 -0
- package/README.md +142 -0
- package/action.yml +36 -0
- package/assets/.gitkeep +0 -0
- package/assets/demo.gif +0 -0
- package/dist/index.js +24102 -0
- package/dist/index.js.map +1 -0
- package/eslint.config.js +13 -0
- package/package.json +60 -0
- package/src/ai.ts +84 -0
- package/src/github.ts +64 -0
- package/src/index.ts +58 -0
- package/tests/ai.test.ts +154 -0
- package/tsconfig.json +23 -0
- package/tsup.config.ts +11 -0
- package/vitest.config.ts +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: ofershap
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
strategy:
|
|
11
|
+
matrix:
|
|
12
|
+
node-version: [20, 22]
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: ${{ matrix.node-version }}
|
|
18
|
+
cache: npm
|
|
19
|
+
- run: npm ci
|
|
20
|
+
- run: npm run lint
|
|
21
|
+
- run: npm run typecheck
|
|
22
|
+
- run: npm test
|
package/.prettierignore
ADDED
package/.prettierrc.json
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ofer Shapira
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# ai-changelog
|
|
2
|
+
|
|
3
|
+
[](https://github.com/ofershap/ai-changelog/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.typescriptlang.org/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
GitHub Action that generates changelogs from your merged pull requests using AI. Runs when a release is published, reads all PRs since the last release, and produces a structured changelog.
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
on:
|
|
11
|
+
release:
|
|
12
|
+
types: [published]
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
changelog:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: ofershap/ai-changelog@v1
|
|
20
|
+
with:
|
|
21
|
+
api-key: ${{ secrets.OPENAI_API_KEY }}
|
|
22
|
+
provider: openai
|
|
23
|
+
model: gpt-4o-mini
|
|
24
|
+
env:
|
|
25
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
> Supports OpenAI and Anthropic. Transforms raw PR titles and metadata into readable release notes. No SDK dependencies, just native fetch.
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
<sub>Demo built with <a href="https://github.com/ofershap/remotion-readme-kit">remotion-readme-kit</a></sub>
|
|
33
|
+
|
|
34
|
+
## Why
|
|
35
|
+
|
|
36
|
+
Writing changelogs is one of those tasks that everyone agrees is important but nobody wants to do. GitHub has built-in auto-generated release notes, but they're just a list of PR titles, which is barely better than `git log`. This action reads your merged PRs, sends them to an AI model, and gets back a properly categorized changelog with human-readable descriptions. It groups changes into Features, Bug Fixes, Breaking Changes, and whatever other categories you define. You can have it update the GitHub Release body automatically, so publishing a release is all it takes to get a proper changelog.
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
Add the action to a workflow that runs on `release: published`:
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
name: Generate Changelog
|
|
44
|
+
|
|
45
|
+
on:
|
|
46
|
+
release:
|
|
47
|
+
types: [published]
|
|
48
|
+
|
|
49
|
+
jobs:
|
|
50
|
+
changelog:
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v4
|
|
54
|
+
- uses: ofershap/ai-changelog@v1
|
|
55
|
+
with:
|
|
56
|
+
api-key: ${{ secrets.OPENAI_API_KEY }}
|
|
57
|
+
provider: openai
|
|
58
|
+
model: gpt-4o-mini
|
|
59
|
+
categories: "Features,Bug Fixes,Breaking Changes,Other"
|
|
60
|
+
update-release: "true"
|
|
61
|
+
env:
|
|
62
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Inputs
|
|
66
|
+
|
|
67
|
+
| Input | Required | Default | Description |
|
|
68
|
+
| ---------------- | -------- | ------------------------------------------- | ------------------------------------------------- |
|
|
69
|
+
| `provider` | No | `openai` | AI provider: `openai` or `anthropic` |
|
|
70
|
+
| `model` | No | `gpt-4o-mini` | Model to use (e.g. `gpt-4o`, `claude-3-haiku`) |
|
|
71
|
+
| `api-key` | Yes | | API key for the AI provider |
|
|
72
|
+
| `categories` | No | `Features,Bug Fixes,Breaking Changes,Other` | Comma-separated changelog categories |
|
|
73
|
+
| `update-release` | No | `true` | Update the GitHub Release body with the changelog |
|
|
74
|
+
|
|
75
|
+
## Outputs
|
|
76
|
+
|
|
77
|
+
| Output | Description |
|
|
78
|
+
| ----------- | ---------------------------- |
|
|
79
|
+
| `changelog` | The generated changelog text |
|
|
80
|
+
|
|
81
|
+
## How It Works
|
|
82
|
+
|
|
83
|
+
1. Runs when a new GitHub Release is published.
|
|
84
|
+
2. Uses the GitHub API to list merged PRs since the previous release.
|
|
85
|
+
3. Builds a text summary of PR numbers, titles, authors, and labels.
|
|
86
|
+
4. Sends the summary to OpenAI or Anthropic with a changelog system prompt.
|
|
87
|
+
5. Optionally writes the generated changelog to the release body.
|
|
88
|
+
|
|
89
|
+
## Supported Providers
|
|
90
|
+
|
|
91
|
+
| Provider | Models (examples) | API Key Secret |
|
|
92
|
+
| ------------- | ------------------------------------ | ------------------- |
|
|
93
|
+
| **OpenAI** | `gpt-4o-mini`, `gpt-4o`, `gpt-4` | `OPENAI_API_KEY` |
|
|
94
|
+
| **Anthropic** | `claude-3-haiku`, `claude-3-sonnet` | `ANTHROPIC_API_KEY` |
|
|
95
|
+
|
|
96
|
+
## Example Output
|
|
97
|
+
|
|
98
|
+
```markdown
|
|
99
|
+
## Features
|
|
100
|
+
|
|
101
|
+
- Added dark mode support for the dashboard (#42)
|
|
102
|
+
- New `--dry-run` flag for migrations (#38)
|
|
103
|
+
|
|
104
|
+
## Bug Fixes
|
|
105
|
+
|
|
106
|
+
- Fixed memory leak in WebSocket handler (#41)
|
|
107
|
+
- Resolved timezone handling for scheduled tasks (#39)
|
|
108
|
+
|
|
109
|
+
## Other
|
|
110
|
+
|
|
111
|
+
- Updated dependencies (#40)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## AI DevOps Suite
|
|
115
|
+
|
|
116
|
+
Part of the AI DevOps suite:
|
|
117
|
+
|
|
118
|
+
- **[ai-commit-msg](https://github.com/ofershap/ai-commit-msg)**: AI-generated conventional commit messages
|
|
119
|
+
- **[ai-pr-reviewer](https://github.com/ofershap/ai-pr-reviewer)**: AI-powered PR review comments
|
|
120
|
+
- **[ai-label-pr](https://github.com/ofershap/ai-label-pr)**: Auto-label PRs by size and type
|
|
121
|
+
- **ai-changelog**: AI-generated changelogs from merged PRs (this project)
|
|
122
|
+
|
|
123
|
+
## Development
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npm install
|
|
127
|
+
npm run typecheck
|
|
128
|
+
npm run build
|
|
129
|
+
npm test
|
|
130
|
+
npm run lint
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Author
|
|
134
|
+
|
|
135
|
+
**Ofer Shapira**
|
|
136
|
+
|
|
137
|
+
[](https://linkedin.com/in/ofershap)
|
|
138
|
+
[](https://github.com/ofershap)
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
[MIT](LICENSE) © [Ofer Shapira](https://github.com/ofershap)
|
package/action.yml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: "AI Changelog"
|
|
2
|
+
description: "Generate AI-powered changelogs from merged PRs when a release is created"
|
|
3
|
+
author: "Ofer Shapira"
|
|
4
|
+
|
|
5
|
+
inputs:
|
|
6
|
+
provider:
|
|
7
|
+
description: "AI provider: openai or anthropic"
|
|
8
|
+
required: false
|
|
9
|
+
default: "openai"
|
|
10
|
+
model:
|
|
11
|
+
description: "Model to use"
|
|
12
|
+
required: false
|
|
13
|
+
default: "gpt-4o-mini"
|
|
14
|
+
api-key:
|
|
15
|
+
description: "API key for the AI provider"
|
|
16
|
+
required: true
|
|
17
|
+
categories:
|
|
18
|
+
description: "Comma-separated changelog categories"
|
|
19
|
+
required: false
|
|
20
|
+
default: "Features,Bug Fixes,Breaking Changes,Other"
|
|
21
|
+
update-release:
|
|
22
|
+
description: "Update the GitHub Release body with the changelog"
|
|
23
|
+
required: false
|
|
24
|
+
default: "true"
|
|
25
|
+
|
|
26
|
+
outputs:
|
|
27
|
+
changelog:
|
|
28
|
+
description: "The generated changelog text"
|
|
29
|
+
|
|
30
|
+
runs:
|
|
31
|
+
using: "node20"
|
|
32
|
+
main: "dist/index.js"
|
|
33
|
+
|
|
34
|
+
branding:
|
|
35
|
+
icon: "file-text"
|
|
36
|
+
color: "blue"
|
package/assets/.gitkeep
ADDED
|
File without changes
|
package/assets/demo.gif
ADDED
|
Binary file
|