Publish GHA evidence items

2 minute read

Use the publish-evidence-item action to capture job-level evidence data in Markdown format in a GHA workflow run and publish it to CloudBees Unify. Evidence is displayed on the Evidence tab of Run details. This action is available on the GitHub Marketplace.

Inputs

Table 1. Input details
Input name Data type Required? Description

content

String

Yes

The content to publish as evidence.

cloudbees-url

String

No

The CloudBees Unify URL. The default value is https://api.cloudbees.io.

The required markup language format for the evidence content is Markdown.

Usage examples

Basic example

The following is a basic example of using the action:

steps: - name: Publish evidence uses: cloudbees-io-gha/publish-evidence-item@v2 with: content: |- # Sample Markdown evidence output - Application endpoint: https://app.example.com/qa - Artifacts - [backend.jar](https://example.com/repo/app/v1.0/backend.jar)

Markdown syntax support

The content input accepts Markdown-formatted text. For more information, refer to the Markdown documentation.

Table 2. Markdown syntax support and examples
Markdown syntax Supported? Example Rendered output

Bulleted list

-item1
-item2

  • item1

  • item2

Character codes

©
|

© |

Code

```
jobs:
  build:
    steps:
    - Compile
```

jobs: build: steps: - Compile

External content

![CBP workflow build video](https://bit.ly/3RagSnN)

Formatting

**bold text**
_italics_

bold text
italics

Headings

# Heading
## Subheading

Heading

Subheading

HTML/Color

Hyperlink

[backend.tar](https://ourcompany.com/repo/backend.tar)

Line break

Quoted text (Blockquotes)

> A block quote of text such as this example.
>
> Anonymous

A block quote of text such as this example.
— Anonymous

Table

Test | Results |
--------|---------|
Test 1 | PASS |
Test 2 | FAIL |
Test 3 | PASS |

Full workflow and run example

The following GHA workflow example uses this action to publish evidence to CloudBees Unify.

Example GHA workflow YAML file
name: Output evidence on: workflow_dispatch: push: branches: - main jobs: run-go-action: runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v3 - name: My evidence uses: cloudbees-io-gha/publish-evidence-item@v2 id: go-action with: content: |- - "This is viewable on the Evidence tab of the run details."

After the run has completed, the evidence output is collected and displayed. Select a job on the left pane in the Evidence tab for that job in the Run details.