Skip to main content

GitHub Action

Dart Code Metrics GitHub Action allows you to integrate Dart Code Metrics into your CI/CD process and get code quality reports inside PR's.

Usage

Create dartcodemetrics.yaml under .github/workflows with the following content (the default configuration listed):

dartcodemetrics.yaml
name: Dart Code Metrics

on: [push]

jobs:
check:
name: dart-code-metrics-action

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: dart-code-metrics
uses: dart-code-checker/dart-code-metrics-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

Inputs

NameRequiredDescriptionDefault
github_token☑️Required to post a report on GitHub. Note: the secret GITHUB_TOKEN is already provided by GitHub and you don't have to set it up yourself.
foldersList of folders whose contents will be scanned.[lib]
relative_pathIf your package isn't at the root of the repository, set this input to indicate its location.
github_patRequired if you had private GitHub repository in the package dependenciesPersonal access token must access to repo and read:user scopes
check_unused_filesAdditional scan for find unused files in package.false

Output example

Analysis result

Analysis result example

Annotation

Annotation example