An open API service indexing awesome lists of open source software.

https://github.com/bansikah22/pr-summarizer

Summarize PR and gives random jokes
https://github.com/bansikah22/pr-summarizer

actions rust-lang rust-library

Last synced: over 1 year ago
JSON representation

Summarize PR and gives random jokes

Awesome Lists containing this project

README

          

# PR Summarizer with Jokes

![GitHub Test Actions Status](https://github.com/bansikah22/pr-summarizer/actions/workflows/test.yml/badge.svg)
![GitHub Test Actions Status](https://github.com/bansikah22/pr-summarizer/actions/workflows/release.yml/badge.svg)
![GitHub Issues](https://img.shields.io/github/issues/bansikah22/pr-summarizer?color=red)
![Open Source](https://img.shields.io/github/license/bansikah22/pr-summarizer?color=green)

A GitHub Action that automatically summarizes pull requests and adds a random programming joke to make code reviews more enjoyable.

## Features

- ๐Ÿ“ **PR Change Analysis**: Detects modified, added, and deleted files
- ๐Ÿ“Š **Summary Generation**: Converts PR changes into short, meaningful descriptions
- ๐Ÿ’ฌ **GitHub Commenting**: Posts the summary as a comment on the PR
- ๐Ÿ˜„ **Random Jokes**: Fetches and appends a programming joke to the comment
- ๐Ÿ”„ **External Repository Support**: Can be used across multiple GitHub repositories

## Example Output

```
๐Ÿš€ PR Summary
๐Ÿ“ Changes Overview
โœจ Implement user authentication system
โœ… Added JWT token generation and validation
โœ… Created user registration endpoint
๐Ÿงช Added tests for auth endpoints
๐Ÿ“š Updated API documentation
๐Ÿ“‚ Affected Files

๐ŸŸข [+] src/auth/jwt.rs
๐ŸŸข [+] src/auth/middleware.rs
๐Ÿ”ต [M] src/routes/users.rs
๐Ÿ”ต [M] src/models/user.rs
๐ŸŸข [+] tests/auth_tests.rs
๐Ÿ”ต [M] README.md

๐Ÿ˜„ Code Humor
Why do programmers prefer dark mode? Because light attracts bugs! ๐Ÿค“

This summary was automatically generated by PR Summarizer โšก
```

## Usage

Add this to your repository's `.github/workflows/pr-summary.yml`:

```yaml
name: PR Summarizer

on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
pull-requests: write # Required to comment on PRs
issues: write # Required for PR comments via issues API

jobs:
summarize:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensures full history for diff analysis

- name: Run PR Summarizer
uses: bansikah22/pr-summarizer@v1.0.0 # Uses the lastest actions tag
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
```

You can also visit test repositories [Test PR Summarizer](https://github.com/bansikah22/test-pr-summarizer) so see how it works on external repositories.

## How It Works

1. When a pull request is opened or updated, the action is triggered
2. It analyzes the changes made in the PR
3. It generates a concise summary of the changes
4. It fetches a programming joke from several APIs
5. It posts a comment on the PR with the summary and joke

## Development

### Prerequisites

- Rust 1.83.+
- Cargo

### Building

```bash
cargo build --release
```

## ๐Ÿค Contributors

We appreciate the efforts of all contributors who help improve this project.

| Contributor | Role |
|-------------------|-----------------------------|
| **Noel Bansikah** | Author & Maintainer |
| **Synk** | Maintainer |
| **Christian Yamele** | Rust Developer |

Contributions are welcomed! ๐ŸŽ‰ Feel free to submit issues, feature requests, or pull requests to help enhance this project.

## ๐Ÿ“œ License

[MIT](./LICENSE) License