Link Search Menu Expand Document

GitHub Maven Plugin

Maven Central

github Goal

Updates a GitHub PR based on json files in gitci format previously generated into standard pitest target directories.

updatePR Goal

Updates a GitHub PR based on previously aggregated json files and meta data. This goal is designed for use in open source projects using GitHub Actions, that must accept PRs from untrusted forks. See pitest blog for details.

Mojo Parameters

When running in GitHub Actions, most required parameters will be autoset from environment variables. These parameters must be explicitly set in other environments.

repoToken

Required (Actions)

A GitHub Api token with access to the checks api.

In GitHub Actions this will be provided as a secret. If it exported as an environment variable named REPO_TOKEN the value will be automatically populated in the plugin.

Token authentication does not work for the checks api outside of GitHub actions. If you are using the plugin with a different CI system a private key and app id should be used to authenticate instead.

appId

Required (Other CI)

Required if authenticated outside of GitHub Actions.

The App Id of a single instance GitHub App with the following permissions

  • Checks - Read & write
  • Issues - Read & write
  • Pull Requests - Read & write

appKeyPath

Required (Other CI)

Required if authenticated outside of GitHub Actions.

The path to the private key registered with a GitHub App in PKCS#8 format.

GitHub generates keys in PKCS#1 format, but they can be converted via openssl using

openssl pkcs8 -topk8 -inform PEM -outform PEM -in key-downloaded-from-github.pem -out app-key.pem -nocrypt

githubRepository

Required

Autoset

The repository to update (e.g octocat/example). If present, this property will be automatically populated from an environment variable named GITHUB_REPOSITORY.

This environment variable is automatically set by GitHub Actions.

githubUrl

Required

Autoset

The base URL of the GitHub api (e.g https://api.github.com). If present, this property will be automatically populated from an environment variable named GITHUB_API_URL.

This environment variable is automatically set by GitHub Actions.

githubEventPath

Required

Autoset

The path to the GitHub PR event payload. If present, this property will be automatically populated from an environment variable named GITHUB_EVENT_PATH.

This environment variable is automatically set by GitHub Actions.

mutantEmoji

Optional

Character string to use in summary table for surviving mutants.

killedEmoji

Optional

Character string to use in summary table when no surviving mutants.

trailingText

Optional

Custom text to place at end of summary.

deleteOldSummaries

Optional

Boolean flag to determine if summary comments created in a PR by previous runs of the plugin should be deleted. Defaults to false.