Use the register-build-artifact and label-artifact-version GitHub Actions to register build artifact metadata from your GHA workflows to CloudBees Unify and manage artifact labels.
For background on how artifact data flows through the platform, refer to Manage workflow artifacts.
Register a build artifact
Use the register-build-artifact action for artifact traceability: inform CloudBees Unify 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.
This action uses GitHub OIDC authentication to securely communicate with CloudBees Unify.
Set permissions to id-token: write in your workflow.
|
Inputs
| Input name | Data type | Required? | Description |
|---|---|---|---|
|
String |
No |
The CloudBees Unify URL.
The default value is |
|
String |
Only required if a different repository/branch. |
The commit ID from the source repository, used when registering the build artifact in CloudBees Unify.
The default is |
|
String |
No |
The ID of the component associated with the artifact. If not provided, the default value is the component ID where the GHA workflow is located. |
|
String |
No, but recommended to help track artifact versions across repositories. |
The hash or checksum that uniquely identifies the artifact version. For more information, refer to Manage workflow artifacts. |
|
String |
No |
A comma-separated list of artifact labels. |
|
String |
Yes |
The name of the artifact reported to CloudBees Unify. |
|
String |
Only required if a different repository/branch. |
The tag or branch of the source repository, used when registering the build artifact in CloudBees Unify.
The default is |
|
String |
Only required if a different repository/branch. |
The clone URL of the source repository, used when registering the build artifact in CloudBees Unify.
The default is |
|
String |
No |
The type of artifact, such as Docker or Maven. |
|
String |
Yes |
The URL where the artifact version is located.
For example, |
|
String |
Yes |
The version of the artifact to send to CloudBees Unify for artifact traceability purposes. |
Outputs
| Output name | Data type | Description |
|---|---|---|
|
String |
The identifier of the artifact sent to CloudBees Unify for artifact traceability purposes. |
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:
Manage artifact version labels
Use the label-artifact-version action to create, update, and remove labels on existing artifact versions in CloudBees Unify.
For more information about organizing artifacts using labels, refer to Manage workflow artifacts.
Inputs
| Input name | Data type | Required? | Description |
|---|---|---|---|
|
String |
Yes |
The identifier of the artifact version in CloudBees Unify.[1] |
|
String |
Yes |
A comma-separated list of artifact labels. |
|
String |
No |
The labeling activity to perform. The following options are valid:
The default is |
|
String |
No |
The CloudBees Unify URL.
The default value is |
[1] Obtain the multi-hexadecimal artifact ID from the output of running the Register a build artifact action in a GHA workflow.
Usage examples
The following basic example adds the labels For Production and Testing Passed to an existing artifact version:
steps: - name: Revise artifact labeling uses: cloudbees-io-gha/label-artifact-version@v1 with: artifact-id: "1234abcd-56ef-7812-90ab-1234abcd3456" labels: "For Production,Testing Passed"
In the following example, an artifact version has three labels, Label1, Label2, and Label3.
Invoking the action removes the Label2 and Label3 labels, so that the artifact remains labeled only with Label1:
steps: - name: Label an artifact uses: cloudbees-io-gha/label-artifact-version@v1 with: artifact-id: "1234abcd-56ef-78ab-90cd-abc123123456" labels: "Label2,Label3" operation: REMOVE
The following example uses this action to register an artifact and then update its labels:
Example GHA workflow YAML file
After the run completes, the artifact label is updated from "For testing" to "For production" for the given artifact version, and the label is displayed in the Artifacts list in CloudBees Unify.