Skip to content

Commit 5e6ba8f

Browse files
committed
2 parents 078447c + 4a80eaa commit 5e6ba8f

File tree

1 file changed

+80
-2
lines changed

1 file changed

+80
-2
lines changed

.github/pr-writer/README.md

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,81 @@
1-
Ensure you have the GROQ_API_KEY secret set in your repository settings.
1+
# PR Summary Generator
22

3-
<!-- TODO make this README better -->
3+
A GitHub Action that automatically generates concise and informative summaries for Pull Requests based on commit messages. Leveraging AI, it enhances the clarity and professionalism of your PR descriptions.
4+
5+
## Table of Contents
6+
- [Features](#features)
7+
- [Installation](#installation)
8+
- [Configuration](#configuration)
9+
- [Usage](#usage)
10+
- [Troubleshooting](#troubleshooting)
11+
- [Contributing](#contributing)
12+
- [License](#license)
13+
14+
## Features
15+
16+
- **Automated Summaries**: Generates PR titles and descriptions from commit messages.
17+
- **AI-Powered**: Utilizes advanced language models to ensure clarity and relevance.
18+
- **Easy Integration**: Simple setup within your GitHub workflows.
19+
- **Customizable**: Configure API keys and tokens as needed.
20+
21+
## Installation
22+
23+
1. **Clone the Repository**:
24+
```bash
25+
git clone https://github.com/your-repo/.github/pr-writer.git
26+
```
27+
2. **Navigate to the Directory**:
28+
```bash
29+
cd .github/pr-writer
30+
```
31+
3. **Install Dependencies**:
32+
```bash
33+
pip install -r requirements.txt
34+
```
35+
36+
## Configuration
37+
38+
Ensure you have the following secrets set in your repository settings:
39+
40+
- `GROQ_API_KEY`: Your API key for Groq.
41+
- `GITHUB_TOKEN`: GitHub token with permissions to create and edit issues.
42+
43+
## Usage
44+
45+
Add the following workflow file to your repository's `.github/workflows` directory:
46+
47+
```yaml
48+
name: "PR Summary Generator"
49+
on:
50+
pull_request:
51+
types: [opened, synchronize]
52+
permissions:
53+
issues: write
54+
contents: read
55+
56+
jobs:
57+
generate_pr_summary:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: ./.github/pr-writer
62+
with:
63+
groq_api_key: ${{ secrets.GROQ_API_KEY }}
64+
github_token: ${{ secrets.GITHUB_TOKEN }}
65+
```
66+
67+
This workflow triggers on pull request events and generates a summary based on commit messages.
68+
69+
## Troubleshooting
70+
71+
- **Missing Environment Variables**: Ensure that `GROQ_API_KEY` and `GITHUB_TOKEN` are correctly set in your repository secrets.
72+
- **API Errors**: Verify that your `GROQ_API_KEY` is valid and has the necessary permissions.
73+
- **Action Fails to Run**: Check the workflow logs for detailed error messages and ensure all dependencies are installed.
74+
75+
## Contributing
76+
77+
Contributions are welcome! Please open issues or submit pull requests for any enhancements or bug fixes.
78+
79+
## License
80+
81+
This project is licensed under the [MIT License](../LICENSE).

0 commit comments

Comments
 (0)