Use this GitHub Action (GHA) for artifact traceability: Inform CloudBees platform that an artifact version has been created, and report any build artifact data generated by a GHA workflow run.
This action is available on the GitHub marketplace.
To learn more about working with artifacts in the platform, refer to the build artifacts documentation.
Prerequisites
Set up the CloudBees platform and GHA to work together, providing key features of the platform to GHA workflows. Refer to Getting started for more information.
Inputs
Input name | Data type | Required? | Description |
---|---|---|---|
|
String |
Yes |
The name of the artifact reported to CloudBees platform. |
|
String |
Yes |
The URL where the artifact version is located.
For example, |
|
String |
Yes |
The version of the artifact to send to CloudBees platform for artifact traceability purposes. |
|
String |
No |
The CloudBees platform URL.
The default value is |
|
String |
No, but it is recommended to help track artifact versions across repositories. For more information, refer to Artifact deployment and publish history. |
The hash or checksum that uniquely identifies the artifact version. |
|
String |
No |
A comma-separated list of artifact labels. |
|
String |
No |
The type of artifact, such as Docker or Maven. |
|
String |
The commit ID from the source repository, used when registering the build artifact in CloudBees platform. |
|
String |
The tag or branch of the source repository, used when registering the build artifact in CloudBees platform. |
|
String |
Outputs
Output name | Data type | Description |
---|---|---|
|
String |
The identifier of the artifact sent to CloudBees platform for artifact traceability purposes. |
This version of the action uses GitHub OIDC authentication to securely communicate with CloudBees platform. Be sure to set permissions to id-token: write in your workflow.
|
Usage examples
The following is a basic example of using the action:
permissions: id-token: write contents: read steps: - name: register-artifact-step uses: cloudbees-io-gha/register-build-artifact@v3 with: name: my-artifact url: https://my-artifact-url.com version: 1.0.0
The following example specifies optional inputs:
Full workflow and run example
The following GHA workflow example uses version v3 of this action. Running this workflow creates an artifact that is reported to CloudBees platform, and the artifact is shown as published by the GHA workflow.
Example GHA workflow YAML file
After the run has completed, the artifact information is displayed in both
and in CloudBees platform. The artifact is shown to be published by the GHA workflow.