CloudBees action: Manage artifact version labels

1 minute read

Use this action to add and remove labels on existing artifact versions in the CloudBees platform. To learn more about organizing your artifacts using labels, refer to Artifact labels.

All CloudBees action repositories are listed at CloudBees, Inc. on GitHub.

Inputs

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

artifact-id

String

Yes

The unique identifier of an artifact version reported to the CloudBees platform.

labels

String

Yes

A comma-separated list of artifact labels.

operation

String

No

The labelling activity to be performed. The following options are valid:

  • ADD, to apply label(s).

  • REMOVE, to remove label(s). The default is ADD.

Usage examples

The following basic example adds the labels For Production and Testing Passed to an existing artifact version:

jobs: add_labels_to_artifact_version: steps: - name: add_labels_to_artifact_version uses: cloudbees-io/label-artifact-version@v1 with: artifact-id: 1234abcd-56ef-78ab-90cd-abcdab123456 labels: For Production,Testing Passed

In the following example, an artifact version has been labelled with Label1, Label2, and Label3. Invoking this action removes the Label2 and Label3 labels, so that the artifact version remains labelled only with Label1.

steps: - name: Unlabel an artifact version uses: cloudbees-io/label-artifact-version@v1 with: artifact-id: 1234abcd-56ef-78ab-90cd-abcdab123456 labels: Label2,Label3 operation: REMOVE