|
| 1 | +// This file was generated using action-binding-generator. Don't change it by hand, otherwise your |
| 2 | +// changes will be overwritten with the next binding code regeneration. |
| 3 | +// See https://github.com/typesafegithub/github-workflows-kt for more info. |
| 4 | +@file:Suppress( |
| 5 | + "DataClassPrivateConstructor", |
| 6 | + "UNUSED_PARAMETER", |
| 7 | +) |
| 8 | + |
| 9 | +package io.github.typesafegithub.workflows.actions.actions |
| 10 | + |
| 11 | +import io.github.typesafegithub.workflows.domain.actions.Action |
| 12 | +import io.github.typesafegithub.workflows.domain.actions.RegularAction |
| 13 | +import java.util.LinkedHashMap |
| 14 | +import kotlin.Boolean |
| 15 | +import kotlin.String |
| 16 | +import kotlin.Suppress |
| 17 | +import kotlin.Unit |
| 18 | +import kotlin.collections.Map |
| 19 | +import kotlin.collections.toList |
| 20 | +import kotlin.collections.toTypedArray |
| 21 | + |
| 22 | +/** |
| 23 | + * Action: Download a Build Artifact |
| 24 | + * |
| 25 | + * Download a build artifact that was previously uploaded in the workflow by the upload-artifact |
| 26 | + * action |
| 27 | + * |
| 28 | + * [Action on GitHub](https://github.com/actions/download-artifact) |
| 29 | + */ |
| 30 | +public data class DownloadArtifactV4 private constructor( |
| 31 | + /** |
| 32 | + * Name of the artifact to download. If unspecified, all artifacts for the run are downloaded. |
| 33 | + */ |
| 34 | + public val name: String? = null, |
| 35 | + /** |
| 36 | + * Destination path. Supports basic tilde expansion. Defaults to $GITHUB_WORKSPACE |
| 37 | + */ |
| 38 | + public val path: String? = null, |
| 39 | + /** |
| 40 | + * A glob pattern matching the artifacts that should be downloaded. Ignored if name is |
| 41 | + * specified. |
| 42 | + */ |
| 43 | + public val pattern: String? = null, |
| 44 | + /** |
| 45 | + * When multiple artifacts are matched, this changes the behavior of the destination |
| 46 | + * directories. If true, the downloaded artifacts will be in the same directory specified by path. |
| 47 | + * If false, the downloaded artifacts will be extracted into individual named directories within |
| 48 | + * the specified path. |
| 49 | + */ |
| 50 | + public val mergeMultiple: Boolean? = null, |
| 51 | + /** |
| 52 | + * The GitHub token used to authenticate with the GitHub API. This is required when downloading |
| 53 | + * artifacts from a different repository or from a different workflow run. If this is not |
| 54 | + * specified, the action will attempt to download artifacts from the current repository and the |
| 55 | + * current workflow run. |
| 56 | + */ |
| 57 | + public val githubToken: String? = null, |
| 58 | + /** |
| 59 | + * The repository owner and the repository name joined together by "/". If github-token is |
| 60 | + * specified, this is the repository that artifacts will be downloaded from. |
| 61 | + */ |
| 62 | + public val repository: String? = null, |
| 63 | + /** |
| 64 | + * The id of the workflow run where the desired download artifact was uploaded from. If |
| 65 | + * github-token is specified, this is the run that artifacts will be downloaded from. |
| 66 | + */ |
| 67 | + public val runId: String? = null, |
| 68 | + /** |
| 69 | + * Type-unsafe map where you can put any inputs that are not yet supported by the binding |
| 70 | + */ |
| 71 | + public val _customInputs: Map<String, String> = mapOf(), |
| 72 | + /** |
| 73 | + * Allows overriding action's version, for example to use a specific minor version, or a newer |
| 74 | + * version that the binding doesn't yet know about |
| 75 | + */ |
| 76 | + public val _customVersion: String? = null, |
| 77 | +) : RegularAction<DownloadArtifactV4.Outputs>("actions", "download-artifact", _customVersion ?: |
| 78 | + "v4") { |
| 79 | + public constructor( |
| 80 | + vararg pleaseUseNamedArguments: Unit, |
| 81 | + name: String? = null, |
| 82 | + path: String? = null, |
| 83 | + pattern: String? = null, |
| 84 | + mergeMultiple: Boolean? = null, |
| 85 | + githubToken: String? = null, |
| 86 | + repository: String? = null, |
| 87 | + runId: String? = null, |
| 88 | + _customInputs: Map<String, String> = mapOf(), |
| 89 | + _customVersion: String? = null, |
| 90 | + ) : this(name=name, path=path, pattern=pattern, mergeMultiple=mergeMultiple, |
| 91 | + githubToken=githubToken, repository=repository, runId=runId, |
| 92 | + _customInputs=_customInputs, _customVersion=_customVersion) |
| 93 | + |
| 94 | + @Suppress("SpreadOperator") |
| 95 | + override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf( |
| 96 | + *listOfNotNull( |
| 97 | + name?.let { "name" to it }, |
| 98 | + path?.let { "path" to it }, |
| 99 | + pattern?.let { "pattern" to it }, |
| 100 | + mergeMultiple?.let { "merge-multiple" to it.toString() }, |
| 101 | + githubToken?.let { "github-token" to it }, |
| 102 | + repository?.let { "repository" to it }, |
| 103 | + runId?.let { "run-id" to it }, |
| 104 | + *_customInputs.toList().toTypedArray(), |
| 105 | + ).toTypedArray() |
| 106 | + ) |
| 107 | + |
| 108 | + override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId) |
| 109 | + |
| 110 | + public class Outputs( |
| 111 | + stepId: String, |
| 112 | + ) : Action.Outputs(stepId) { |
| 113 | + /** |
| 114 | + * Path of artifact download |
| 115 | + */ |
| 116 | + public val downloadPath: String = "steps.$stepId.outputs.download-path" |
| 117 | + } |
| 118 | +} |
0 commit comments