8000 GitHub - srajasimman/time-to-review: A GitHub Action that automatically estimates the time required to review a pull request and adds an appropriate time-based label.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A GitHub Action that automatically estimates the time required to review a pull request and adds an appropriate time-based label.

License

Notifications You must be signed in to change notification settings

srajasimman/time-to-review

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Time to Review

A GitHub Action that automatically estimates the time required to review a pull request and adds an appropriate time-based label. image

How it works

This action analyzes pull requests and applies labels like 1 min review, 5 min review, etc., to help reviewers prioritize their work. It considers several factors:

  1. Number of files changed
  2. Lines of code added and deleted
  3. File complexity based on file extensions
  4. Quality of commit messages (Conventional Commits check)
  5. Size of individual commits
  6. Quality of pull request description
  7. Commit type (feat, fix, refactor, revert, docs)
  8. Documentation and metadata file changes

Special handling

  • Documentation and metadata files: Pull requests containing only documentation or metadata files are automatically assigned the minimum review time (1 minute). In mixed PRs, changes to documentation files are weighted at only 20% compared to code changes.

  • Commit types: Different commit types receive different review time weights:

    • feat: +2 minutes (new features need more review time)
    • fix: +1.5 minutes (bug fixes need careful review)
    • refactor: +2.5 minutes (refactorings need thorough review)
    • revert: +1 minute (reverts typically need less review time)
    • docs: +0.5 minutes (documentation changes need minimal review)

Usage

Add this to your workflow file (e.g., .github/workflows/time-to-review.yml):

name: Time to Review

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  time-to-review:
    runs-on: ubuntu-latest
    name: Calculate review time
    steps:
      - name: Checkout code
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      
      - name: Calculate review time
        uses: srajasimman/time-to-review@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

Labels

The action will add one of the following labels to your pull request:

  • 1 min review (🟢 Green)
  • 5 min review (🟡 Yellow)
  • 10 min review (🟡 Yellow)
  • 15 min review (🔴 Red)
  • 20 min review (🔴 Red)
  • 30 min review (🔴 Red)

The labels are color-coded for quick visual priority assessment:

  • Green: Quick reviews (1 minute)
  • Yellow: Medium reviews (5-10 minutes)
  • Red: Longer reviews (>10 minutes)

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A GitHub Action that automatically estimates the time required to review a pull request and adds an appropriate time-based label.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0