GitHub Action: Publish an evidence item to the CloudBees platform

2 minute read

Use this GitHub Action (GHA) to capture job-level evidence data in Markdown format in a GHA workflow run and publish it to the CloudBees platform. The evidence is displayed on the Evidence tab of Run details for your run. For more information, refer to Evidence.

This action is available on the GitHub marketplace.

This action is a Preview feature and is not yet fully supported by CloudBees.

A Preview feature:
  • Has not undergone end-to-end testing with CloudBees products.

  • Is provided without service-level agreements (SLA), and therefore does not include CloudBees' commitment to functionality or performance.

  • May impact other stable areas of the product when used.

  • May have limited documentation.

  • May not be feature-complete during the Preview period.

  • May graduate from Preview to a supported feature or be removed from the product.

  • May introduce breaking changes that prevent upgrades due to incompatibility with future development.

Product features and documentation are frequently updated. If you find an issue or have a suggestion, please contact CloudBees Support.

Inputs

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

cloudbees-pat

String

Yes

content

String

Yes

The content to be published as evidence.

cloudbees-url

String

No

The CloudBees platform 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-gha-cbp/publish-evidence-item@v1 with: cloudbees-pat: ${{ secrets.MY_PAT }} content: |- # Sample Markdown evidence output - Application endpoint: https://app.example.com/qa - Artifacts - [backend.jar](https://example.com/repo/app/v1.0/backend.jar)

Full workflow and run example

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

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: Set up environment variable for PAT run: echo "MY_PAT=${{ secrets.MY_PAT }}" - name: My evidence uses: cloudbees-gha-cbp/publish-evidence-item@v1 id: go-action with : cloudbees-pat: ${{ secrets.QA_PAT }} # content: "This is viewable on the Evidence tab of the run details."

After the run has completed, the evidence output is collected and displayed in the Evidence tab of Run details.

Evidence output
Figure 1. Example evidence data in Run details
This action also supports system property references, such as ${{ cloudbees.run_id }} or ${{ vars.api_endpoint }}.

Markdown syntax support

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 |

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