@@ -11,6 +11,7 @@ package io.github.typesafegithub.workflows.actions.actions
1111import io.github.typesafegithub.workflows.domain.actions.Action
1212import io.github.typesafegithub.workflows.domain.actions.RegularAction
1313import java.util.LinkedHashMap
14+ import kotlin.Boolean
1415import kotlin.Int
1516import kotlin.String
1617import kotlin.Suppress
@@ -42,6 +43,9 @@ import kotlin.collections.toTypedArray
4243 * as GNU Gzip) - 9: Best compression Higher levels will result in better compression, but will take
4344 * longer to complete. For large files that are not easily compressed, a value of 0 is recommended for
4445 * significantly faster uploads.
46+ * @param overwrite If true, an artifact with a matching name will be deleted before a new one is
47+ * uploaded. If false, the action will fail if an artifact for the given name already exists. Does not
48+ * fail if the artifact does not exist.
4549 * @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
4650 * the binding
4751 * @param _customVersion Allows overriding action's version, for example to use a specific minor
@@ -77,6 +81,12 @@ public data class UploadArtifactV4 private constructor(
7781 * significantly faster uploads.
7882 */
7983 public val compressionLevel : UploadArtifactV4 .CompressionLevel ? = null ,
84+ /* *
85+ * If true, an artifact with a matching name will be deleted before a new one is uploaded. If
86+ * false, the action will fail if an artifact for the given name already exists. Does not fail if
87+ * the artifact does not exist.
88+ */
89+ public val overwrite : Boolean? = null ,
8090 /* *
8191 * Type-unsafe map where you can put any inputs that are not yet supported by the binding
8292 */
@@ -94,10 +104,11 @@ public data class UploadArtifactV4 private constructor(
94104 ifNoFilesFound: UploadArtifactV4 .BehaviorIfNoFilesFound ? = null ,
95105 retentionDays: UploadArtifactV4 .RetentionPeriod ? = null ,
96106 compressionLevel: UploadArtifactV4 .CompressionLevel ? = null ,
107+ overwrite: Boolean? = null ,
97108 _customInputs : Map <String , String > = mapOf (),
98109 _customVersion : String? = null ,
99110 ) : this (name= name, path= path, ifNoFilesFound= ifNoFilesFound, retentionDays= retentionDays,
100- compressionLevel= compressionLevel, _customInputs = _customInputs ,
111+ compressionLevel= compressionLevel, overwrite = overwrite, _customInputs = _customInputs ,
101112 _customVersion = _customVersion )
102113
103114 @Suppress(" SpreadOperator" )
@@ -108,6 +119,7 @@ public data class UploadArtifactV4 private constructor(
108119 ifNoFilesFound?.let { " if-no-files-found" to it.stringValue },
109120 retentionDays?.let { " retention-days" to it.integerValue.toString() },
110121 compressionLevel?.let { " compression-level" to it.integerValue.toString() },
122+ overwrite?.let { " overwrite" to it.toString() },
111123 * _customInputs .toList().toTypedArray(),
112124 ).toTypedArray()
113125 )
0 commit comments