Skip to content
file

GitHub Action

cs2pr

v1 Latest version

cs2pr

file

cs2pr

Convert checkstyle XML to GitHub PR annotations

Installation

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

              

- name: cs2pr

uses: staabm/annotate-pull-request-from-checkstyle-action@v1

Learn more about this action in staabm/annotate-pull-request-from-checkstyle-action

Choose a version

annotate-pull-request-from-checkstyle-action

annotate-pull-request-from-checkstyle-action is a GitHub Action that uses cs2pr to converts checkstyle XML files to GitHub PR annotations.

Context Example Images from https://github.com/mheap/phpunit-github-actions-printer

Usage

name: CS2PR
on:
  - pull_request

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: staabm/annotate-pull-request-from-checkstyle-action@v1
        with:
          files: checkstyle.xml
          notices-as-warnings: true # optional

Action Inputs

  • files (Required) - The checkstyle XML files to convert to GitHub PR annotations separated by semicolons
  • graceful-warnings (Optional) - Don't exit with error codes if there are only warnings
    • Expected value: "true"
  • colorize (Optional) - Colorize the output (still compatible with Github Annotations)
    • Expected value: "true"
  • notices-as-warnings (Optional) - Convert notices to warnings (Github does not annotate notices otherwise)
    • Expected value: "true"
  • errors-as-warnings: (Optional) - Downgrade errors to warnings
    • Expected value: "true"
  • prepend-filename (Optional) - Prepend error 'filename' attribute to the message
    • Expected value: "true"
  • prepend-source (Optional) - Prepend error 'source' attribute to the message
    • Expected value: "true"