Skip to main content

GitHub Action

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


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

name: DCM

on: [push]

name: dcm-action

runs-on: ubuntu-latest

- uses: actions/[email protected]

- name: dcm
uses: dart-code-checker/dart-code-metrics-[email protected]
github_token: ${{ secrets.GITHUB_TOKEN }}


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.
github_patRequired if you had private GitHub repository in the package dependenciesPersonal access token must access to repo and read:user scopes
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.
pull_request_commentPublish detailed report commented directly into your pull request.false
analyze_report_title_patternConfigurable analyze report title pattern.DCM analyze report of $packageName
fatal_warningsTreat warning level issues as fatal.false
fatal_performanceTreat performance level issues as fatal.false
fatal_styleTreat style level issues as fatal.false
check_unused_filesAdditional scan for find unused files in package.false
check_unused_files_foldersList of folders whose contents will be scanned for find unused files.Taken from folders argument
unused_files_report_title_patternConfigurable unused files report title pattern.DCM unused files report of $packageName

Output example

Analysis result

Analysis result example


Annotation example