Use this GitHub Action (GHA) for artifact traceability: Inform the 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 |
|
|
String |
Yes |
The name of the artifact to send to the CloudBees platform for artifact traceability purposes. |
|
String |
Yes |
The version of the artifact to send to the CloudBees platform for artifact traceability purposes. |
|
String |
Yes |
The URL where the artifact version can be pulled for deployment. |
|
String |
No |
The CloudBees platform URL.
The default value is |
|
String |
No |
The artifact digest that uniquely identifies the artifact. |
|
String |
No |
The type of artifact, such as Docker or Maven. |
Usage examples
The following is a basic example of using the v2 action:
steps: - name: register-artifact-step uses: cloudbees-io-gha/register-build-artifact@v2 with: cloudbees-pat: ${{ secrets.CloudBees-platform-PAT }} name: my-artifact version: 1.0.0 url: "https://my-artifact-url.com"
The following example specifies the artifact digest:
steps: - name: register-artifact-step-digest uses: cloudbees-io-gha/register-build-artifact@v2 with: cloudbees-url: "https://api.cloudbees.io" cloudbees-pat: ${{ secrets.CloudBees-platform-PAT }} name: my-Docker-artifact version: 1.0.0 url: "https://hub.docker.com/repository/docker/example" digest: "sha256:abcdef1234567890" type: "Docker"
Full workflow and run example
The following GHA workflow example uses version v2 of this action. Running this workflow creates an artifact that is reported to the 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 the CloudBees platform. The artifact is shown to be published by the GHA workflow.