Skip to content

PR Risk Score

Automated risk assessment for pull requests using GitHub Actions.


PR Risk Score

Automatically assess the risk of pull requests by combining impact, regression, security, and coupling analysis.

Requirements

  • Plan: Cloud Team or higher
  • API Key: With write scope

How It Works

PR Risk Score analyzes four dimensions of risk:

DimensionWeightWhat It Measures
Impact30%Blast radius of changes across the codebase
Regression25%Likelihood of breaking existing functionality
Security25%Security implications of the changes
Coupling20%Cross-module dependencies affected

Risk Ratings

ScoreRatingMeaning
0-30LowSafe to merge with standard review
31-60MediumRequires careful review
61-80HighNeeds senior review and testing
81-100CriticalBlock merge until risks addressed

GitHub Actions Setup

Add this workflow to your repository:

  1. Copy the workflow file from your Massu dashboard or download it from https://massu.ai/massu-risk-score-action.yml
  1. Save it as .github/workflows/massu-risk-score.yml
  1. Add your API key as a repository secret:

- Go to Settings > Secrets > Actions - Add MASSU_API_KEY with your API key (must have write scope)

  1. Pull requests will now automatically receive risk score comments.

API Usage

Submit a PR for risk scoring directly via the API:

bash
curl -X POST https://massu.ai/api/v1/risk \
  -H "Authorization: Bearer ms_live_XXXXXXXX_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "repo": "org/repo",
    "pr_number": 42,
    "pr_title": "Add user authentication",
    "files_changed": 15,
    "impact_data": { "score": 65 },
    "regression_data": { "score": 40 },
    "security_data": { "score": 80 },
    "coupling_data": { "score": 30 }
  }'

Dashboard

View risk scores for all your PRs at Dashboard > PR Risk Scores, including:

  • Average risk score across PRs
  • High-risk PR count
  • Score breakdown visualization
  • Trend analysis