You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds isBuildArtifact field to Artifacts.
This field will allow Tekton Chains to understand user's desire
and appropriate add the artifact as a subject or a byProduct in
the SLSA provenance.
Copy file name to clipboardExpand all lines: docs/artifacts.md
+49
Original file line number
Diff line number
Diff line change
@@ -155,6 +155,55 @@ spec:
155
155
156
156
It is recommended to use [purl format](https://github.com/package-url/purl-spec/blob/master/PURL-SPECIFICATION.rst) for artifacts uri as shown in the example.
157
157
158
+
### Output Artifacts in SLSA Provenance
159
+
160
+
Artifacts are classified as either:
161
+
162
+
- Build Outputs - packages, images, etc. that are being published by the build.
163
+
- Build Byproducts - logs, caches, etc. that are incidental artifacts that are produced by the build.
164
+
165
+
By default, Tekton Chains will consider all output artifacts as `byProducts` when generating in the [SLSA provenance](https://slsa.dev/spec/v1.0/provenance). In order to treat an artifact as a [subject](https://slsa.dev/spec/v1.0/provenance#schema) of the build, you must set a boolean field `"buildOutput": true` for the output artifact.
166
+
167
+
e.g.
168
+
```yaml
169
+
apiVersion: tekton.dev/v1
170
+
kind: TaskRun
171
+
metadata:
172
+
generateName: step-artifacts-
173
+
spec:
174
+
taskSpec:
175
+
description: |
176
+
A simple task that populates artifacts to TaskRun stepState
This informs Tekton Chains your desire to handle the artifact.
203
+
204
+
> [!TIP]
205
+
> When authoring a `StepAction` or a `Task`, you can parametrize this field to allow users to indicate their desire depending on what they are uploading - this can be useful for actions that may produce either a build output or a byproduct depending on the context!
206
+
158
207
### Passing Artifacts between Steps
159
208
You can pass artifacts from one step to the next using:
160
209
- Specific Artifact: `$(steps.<step-name>.inputs.<artifact-category-name>)`or `$(steps.<step-name>.outputs.<artifact-category-name>)`
Copy file name to clipboardExpand all lines: pkg/apis/pipeline/v1/swagger.json
+6-1
Original file line number
Diff line number
Diff line change
@@ -155,11 +155,16 @@
155
155
"description": "TaskRunStepArtifact represents an artifact produced or used by a step within a task run. It directly uses the Artifact type for its structure.",
156
156
"type": "object",
157
157
"properties": {
158
+
"buildOutput": {
159
+
"description": "Indicate if the artifact is a build output or a by-product",
160
+
"type": "boolean"
161
+
},
158
162
"name": {
163
+
"description": "The artifact's identifying category name",
159
164
"type": "string"
160
165
},
161
166
"values": {
162
-
"description": "The artifact's identifying category name",
167
+
"description": "A collection of values related to the artifact",
Copy file name to clipboardExpand all lines: pkg/apis/pipeline/v1beta1/swagger.json
+6-1
Original file line number
Diff line number
Diff line change
@@ -155,11 +155,16 @@
155
155
"description": "TaskRunStepArtifact represents an artifact produced or used by a step within a task run. It directly uses the Artifact type for its structure.",
156
156
"type": "object",
157
157
"properties": {
158
+
"buildOutput": {
159
+
"description": "Indicate if the artifact is a build output or a by-product",
160
+
"type": "boolean"
161
+
},
158
162
"name": {
163
+
"description": "The artifact's identifying category name",
159
164
"type": "string"
160
165
},
161
166
"values": {
162
-
"description": "The artifact's identifying category name",
167
+
"description": "A collection of values related to the artifact",
0 commit comments