Skip to content

Commit 802b28c

Browse files
committed
v1.0 release
1 parent acc680a commit 802b28c

File tree

4 files changed

+50
-138
lines changed

4 files changed

+50
-138
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

.github/workflows/licensed.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

README.md

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,48 @@
1-
# OpenAI Summarize Diff Action
1+
# openai summarize diff action
2+
[![node.js ci](https://github.com/captradeoff/openai-summarize-diff-action/actions/workflows/node.js.yml/badge.svg)](https://github.com/captradeoff/openai-summarize-diff-action/actions/workflows/node.js.yml)
3+
![GitHub License](https://img.shields.io/github/license/captradeoff/openai-summarize-diff-action)
24

3-
This GitHub Action receives a git diff (e.g., a PR diff) and uses OpenAI to summarize and explain the changes made in that diff in a clear, concise way.
5+
this github action receives a git diff (e.g., a pr diff) and uses openai to summarize and explain the changes made in that diff in a clear, concise way.
46

5-
## Features
7+
## features
68

7-
- Generates concise explanations of code changes
8-
- Customizable output length and style
9-
- Easy to integrate into your CI/CD workflow
10-
- Now includes comprehensive tests and error handling
9+
- generates concise explanations of code changes
10+
- customizable output length and style
11+
- easy to integrate into your ci/cd workflow
12+
- now includes comprehensive tests and error handling
1113

12-
## Inputs
14+
## inputs
1315

1416
### `diff`
1517

16-
**Required** The diff to be explained.
18+
**required** the diff to be explained.
1719

1820
### `apikey`
1921

20-
**Required** Your OpenAI API key. Get one at [OpenAI Platform](https://platform.openai.com/api-keys).
22+
**required** your openai api key. get one at [openai platform](https://platform.openai.com/api-keys).
2123

22-
### `examplePostSummary`
24+
### `examplepostsummary`
2325

24-
**Optional** An example summary to guide the model's output style.
25-
Default: "update the code with new features: parallelisation, caching, and better error handling"
26+
**optional** an example summary to guide the model's output style.
27+
default: "update the code with new features: parallelisation, caching, and better error handling"
2628

27-
### `maxTokens`
29+
### `maxtokens`
2830

29-
**Optional** Maximum number of tokens to generate. Default: `30`
31+
**optional** maximum number of tokens to generate. default: `30`
3032

31-
### `maxCharacters`
33+
### `maxcharacters`
3234

33-
**Optional** Maximum characters in the generated explanation. Default: `140`
35+
**optional** maximum characters in the generated explanation. default: `140`
3436

35-
## Outputs
37+
## outputs
3638

3739
### `explanation`
3840

39-
The explanation and summary of the diff generated by OpenAI.
41+
the explanation and summary of the diff generated by openai.
4042

41-
## Example usage
43+
## example usage
4244

43-
### To explain the changes made in a PR
45+
### to explain the changes made in a pr
4446

4547
```yaml
4648
name: Explain PR Changes
@@ -78,7 +80,7 @@ jobs:
7880
run: echo "${{ steps.explain.outputs.explanation }}"
7981
```
8082
81-
### To explain the changes and post the result as a comment in the PR
83+
### to explain the changes and post the result as a comment in the pr
8284
8385
```yaml
8486
name: Explain PR Changes and Comment
@@ -130,62 +132,62 @@ jobs:
130132
EXPLANATION: ${{ steps.explain.outputs.explanation }}
131133
```
132134
133-
## Local Development
135+
## local development
134136
135-
### Setup
137+
### setup
136138
137-
1. Clone the repository:
139+
1. clone the repository:
138140
```bash
139141
git clone https://github.com/your-username/openai-summarize-diff-action.git
140142
cd openai-summarize-diff-action
141143
```
142144

143-
2. Install dependencies:
145+
2. install dependencies:
144146
```bash
145147
npm install
146148
```
147149

148-
3. Create a `.env` file with your OpenAI API key:
150+
3. create a `.env` file with your openai api key:
149151
```
150152
OPENAI_API_KEY=your_api_key_here
151153
```
152154

153-
### Testing
155+
### testing
154156

155-
Run tests:
157+
run tests:
156158
```bash
157159
npm test
158160
```
159161

160-
Run tests with coverage:
162+
run tests with coverage:
161163
```bash
162164
npm run test:coverage
163165
```
164166

165-
Run tests in watch mode (useful during development):
167+
run tests in watch mode (useful during development):
166168
```bash
167169
npm run test:watch
168170
```
169171

170-
### Linting
172+
### linting
171173

172-
Run linting:
174+
run linting:
173175
```bash
174176
npm run lint
175177
```
176178

177-
### Building
179+
### building
178180

179-
Build the action:
181+
build the action:
180182
```bash
181183
npm run build
182184
```
183185

184-
This will run linting, tests, and then build the action into the `dist` directory.
186+
this will run linting, tests, and then build the action into the `dist` directory.
185187

186-
### Manual Testing
188+
### manual testing
187189

188-
You can test the action locally by creating a test script:
190+
you can test the action locally by creating a test script:
189191

190192
```javascript
191193
// test-local.js
@@ -219,17 +221,17 @@ index 123..456 789
219221
test();
220222
```
221223

222-
Run the test script:
224+
run the test script:
223225
```bash
224226
node test-local.js
225227
```
226228

227-
## Notes
229+
## notes
228230

229-
- This action uses OpenAI's GPT-4o-mini model by default.
230-
- Make sure to store your OpenAI API key as a secret in your repository settings.
231-
- The action will ignore library folders to focus on meaningful code changes.
231+
- this action uses openai's gpt-4o-mini model by default.
232+
- make sure to store your openai api key as a secret in your repository settings.
233+
- the action will ignore library folders to focus on meaningful code changes.
232234

233-
## License
235+
## license
234236

235-
ISC
237+
[mit](https://github.com/captradeoff/openai-summarize-diff-action/blob/main/LICENSE)

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'OpenAI Summarize Diff'
2-
description: 'Uses OpenAI to explain and summarize git diffs in a clear, concise way'
2+
description: 'Uses OpenAI to explain the changes in the last git diff in a concise manner'
33
inputs:
44
diff:
55
description: 'The Git diff to be explained'
@@ -23,6 +23,6 @@ runs:
2323
using: 'node20'
2424
main: 'dist/index.js'
2525
branding:
26-
icon: 'message-square'
27-
color: 'green'
26+
icon: 'code'
27+
color: 'white'
2828

0 commit comments

Comments
 (0)