Use this action to register multiple artifact versions in CloudBees Unify from a workflow run. The action accepts a JSON array of artifact metadata objects, allowing you to register multiple artifacts in a single step.
|
💡
|
When registering just one artifact version, you can use register-build-artifact as an alternative to this action. |
|
Note
|
Do not include the
|
| Input name | Data type | Required? | Description |
|---|---|---|---|
|
String (JSON) |
YES |
A JSON array of artifact metadata objects. Each object must include:
|
[1] Unlike the register-build-artifact action, by default this action does not associate the artifact version with the code commit associated with the workflow run in the workflow’s repository/branch. If you want to associate a commit with this artifact version, specify the commit, repository and branch to use.
| Output name | Data type | Description |
|---|---|---|
|
JSON string |
The output is a JSON object mapping each artifact’s |
jobs:
register_build_artifacts:
steps:
- name: Register Build Artifacts
uses: cloudbees-io/register-build-artifacts@main
id: register
with:
artifact-metadata: |
[
{
"name": "myApp",
"version": "1.0.0",
"url": "docker.io/myapp/myimg:1.0.0",
"type": "docker"
}
]jobs:
register_build_artifacts:
steps:
- name: Register Build Artifacts
uses: cloudbees-io/register-build-artifacts@main
id: register
with:
artifact-metadata: |
[
{
"name": "myApp",
"version": "1.0.0",
"url": "docker.io/myapp/myimg:1.0.0",
"type": "docker"
},
{
"name": "myService",
"url": "docker.io/myorg/myservice:2.3.4",
"version": "2.3.4",
"labels": [
"api",
"custom, label",
"\"custom label\"",
"backend:v1"
],
"repositoryUrl": "https://github.com/example/myservice.git",
"commitId": "789xyz654wvu",
"ref": "refs/tags/v2.3.4",
"digest": "sha256:abcdef1234567890",
"componentId": "fa0592f9-88f8-4f5d-9f37-580a93ba55ce",
"type": "docker"
}
]- name: Register artifacts 2
id: register
uses: cloudbees-io/register-build-artifacts@main
with:
artifact-metadata: |
[
{
"name": "myApp2",
"version": "1.0.02",
"url": "docker.io/myapp/myimg:1.0.02"
}
]
- name: Print output parameter artifact IDs
uses: docker://alpine:latest
shell: sh
run: |
echo "Artifact IDs: ${{ steps.register.outputs.artifact-ids }}"This code is made available under the MIT license.
-
Learn more about using actions in CloudBees workflows.
-
Learn about CloudBees Unify.