Skip to content

About

GitHub Action for Devscope repository analysis, code-health checks, and pull-request reports.

Topics

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

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

Devscope Action

Give reviewers a useful place to start.

Add an evidence-led checklist to each PR: changed files, co-change facts and optional patch coverage. Share an updated comment plus offline HTML, JSON and Markdown reports. Start advisory; choose blocking gates later.

Devscope makes no predictive risk claim. Its preregistered evaluation could not beat ranking by file size, so CLI 0.4.0 removes model scores and presents Git history only as inspectable context. Read the negative result.

Tests

Actual Devscope report on the integration PR

See the actual comment · Try the CLI demo

Add it to a repository

Save as .github/workflows/devscope.yml. This example reports findings without blocking a merge based on new warnings.

name: Devscope review
on: pull_request
permissions:
  contents: read
  pull-requests: write
jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          fetch-depth: 0
      - uses: EhsanAzish80/devscope-action@v1.4.0
        with:
          review: 'true'
          devscope-version: '0.4.1'

Action 1.4.0 uses CLI 0.4.1 by default; the explicit version keeps your workflow reproducible. @v1 follows the latest compatible Action release. Prefer the versioned tag when you want deliberate upgrades.

Copy the complete review workflow. Only need compact count deltas? Use the comparison workflow. For a job summary with no comment permission, use the CLI-only workflow.

Read the result

  • PR comment: one bot report is updated on each run. Read-only tokens skip the comment while retaining the job summary and report artifacts.
  • Offline report: download the devscope-review-<OS> artifact from the job, then open review.html. It includes filtering and complete structured data.
  • Evidence: size/churn are review heuristics. Coverage is imported from a supplied report; test-file counts do not establish coverage or passing tests.

Offline demo report; all sample data is synthetic

Download the labelled sample HTML

Enable a new-warning gate when ready

Commit .devscope.json and, optionally, .devscope-baseline.json on the target branch. Add fail-on-new: 'true' alongside review: 'true'. Existing and accepted findings do not fail this gate. Reports and artifacts are produced before it returns a failure, so reviewers can inspect the evidence.

Both snapshots use the target commit's policy and baseline; a PR cannot weaken its own gate by editing them, .gitignore or archive attributes. Initial warning rules are large non-test source files and zero-hit added executable lines in supplied coverage. Absolute grade/risk/onboarding gates are separate and opt-in.

Configuration, baselines and monorepos

Add measured coverage

Generate LCOV or Cobertura coverage for the exact checked-out PR head in an earlier step. Then add these inputs:

coverage: coverage.info
coverage-commit: ${{ github.event.pull_request.head.sha }}

The commit is a caller-supplied provenance assertion, not independent proof of freshness. Lines absent from the report remain unmapped/unknown. Use coverage-root when the report records absolute paths from another machine.

Inputs

Input Default Purpose
path . Directory to scan; review/compare require the repository root
review false PR checklist, history evidence and report artifacts
compare false Compact PR count comparison; review supersedes it when both are enabled
devscope-version 0.4.1 Published CLI package version
devscope-ref unset Advanced override: full upstream CLI commit SHA
fail-on-new false Block new configured review warnings; requires review mode
package unset Repository-relative package scope; requires review mode
coverage unset LCOV/Cobertura report path; requires review mode
coverage-commit unset Report producer's commit; must match reviewed head
coverage-root unset Original repository-root prefix in coverage paths
artifact-name devscope-review Artifact prefix; OS is appended; change for repeated uses in one job
fail-under unset Absolute minimum heuristic grade, A–F
max-risk unset Absolute maximum label: Low, Medium, High
max-onboarding unset Absolute maximum label: Easy, Moderate, Hard
github-token github.token Token for the optional PR comment

Review/comparison run on pull_request events; absolute thresholds apply on both PRs and pushes. Boolean inputs accept true or false. Coverage/package inputs and fail-on-new require review mode. Missing history or analysis errors fail setup instead of producing a default grade.

Outputs

Output Value
comparison-report Local Markdown report path, empty when reporting is skipped
review-html, review-json Local advanced report paths
new-warnings New warning count, empty outside review mode
health, grade, risk, onboarding Working-tree heuristic summary fields

The legacy risk health label is a static code-health heuristic for compatibility; it is not a defect probability or the removed history model.

Reports are available to later steps in the same job; advanced artifacts are retained for 7 days. Long comments/summaries point to complete report files. Reviews use committed snapshots; working-tree health metrics can also include files generated by earlier steps. No repository commands are executed by review.

For fork PR comments, retain the normal unprivileged PR workflow. Do not switch to pull_request_target to execute an untrusted checkout with a write token.

Development

bash tests/test-action.sh
python3 -m unittest discover -s tests -p 'test_*.py'
node --test tests/comment.test.cjs

CI tests the published CLI on Ubuntu, macOS and Windows, including artifacts, permissive gates, a real regression gate and the first-run demo. CLI 0.4.1 and Action 1.4.0 replace the source pins needed during development.

MIT licensed. See LICENSE.

About

GitHub Action for Devscope repository analysis, code-health checks, and pull-request reports.

Topics

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages