Skip to content
code

GitHub Action

Analysis Publisher

0.0.1 Latest version

Analysis Publisher

code

Analysis Publisher

Publish code analysis results as diff annotations

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Analysis Publisher

uses: digirati-labs/[email protected]

Learn more about this action in digirati-labs/analysis-publisher

Choose a version

Analysis Publisher

analysis-publisher is a tool that searches your project for code quality reports and publishes an aggregate to external services. A large variety of report formats are supported, and can currently be published to GitHub.

Codecov

Dual-licensed under ISC or ASL 2.0.

What publishers are supported?

Each publisher implementation may differ slightly in how issues are published, but ideally reports are published as line annotations on sections of code. All supported publishers are listed below:

What report formats are supported?

The analysis-model library from Jenkins is used to parse issue reports, and as such analysis-publisher supports all formats from the upstream Jenkins plugin.

Note: only a few of these publishers are currently registered, see IssueParserFactoryBuilder.java for a list of supported report parsers.

Usage

A Docker image is available containing a compiled binary of the analysis publisher application, which can be used to upload analysis reports in a GitHub action.

Command-Line

To get detailed help on the options available on the command-line see the output of:

analysis-publisher --help

At least one report specification must be given using the repeatable --report-type and --path options, as well as one publisher specification:

analysis-publisher --report-type=spotbugs --path=**/spotbugs.xml --publisher=github_check

By default publishers will be configured by environment variables set in the execution environment, but can be overriden using properties set on the command-line:

analysis-publisher --publisher=github_check \
  --property=github.repository garyttierney/analysis-publisher \
  --property=github.token TEST_TOKEN

Documentation on available publisher properties can be found in the documentation for the specific publisher listed above.

GitHub Actions

workflow "analysis-publisher/ci" {
  on = "push"
  resolves = [
    "analysis-publisher/ci/publish-analysis",
  ]
}

action "analysis-publisher/ci/analyze" {
  uses = "openjdk:11"
  runs = ["./gradlew", "check"]
}

action "analysis-publisher/ci/publish-analysis" {
  needs = ["analysis-publisher/ci/analyze"]
  secrets = ["GITHUB_TOKEN"]

  uses = "garyttierney/analysis-publisher@master"
  args = [
    "--report-type=checkstyle", "--path=**/checkstyle/*.xml",
    "--report-type=spotbugs", "--path=**/spotbugs/*.xml",
    "--publisher=github_check"
  ]
}

Examples

This repository publishes its own code quality reports with every commit, and can be seen in the check runs for each commit.