gh_workflow/
artifacts.rs

1//!
2//! Artifact types for GitHub workflow job outputs and inputs.
3
4use derive_setters::Setters;
5use serde::{Deserialize, Serialize};
6
7/// Represents artifacts produced by jobs.
8#[derive(Debug, Setters, Serialize, Deserialize, Clone, Default, PartialEq, Eq)]
9#[serde(rename_all = "kebab-case")]
10#[setters(strip_option, into)]
11pub struct Artifacts {
12    /// Artifacts to upload after the job.
13    #[serde(skip_serializing_if = "Option::is_none")]
14    pub upload: Option<Vec<Artifact>>,
15
16    /// Artifacts to download before the job.
17    #[serde(skip_serializing_if = "Option::is_none")]
18    pub download: Option<Vec<Artifact>>,
19}
20
21/// Represents an artifact produced by a job.
22#[derive(Debug, Setters, Serialize, Deserialize, Clone, Default, PartialEq, Eq)]
23#[serde(rename_all = "kebab-case")]
24#[setters(strip_option, into)]
25pub struct Artifact {
26    /// The name of the artifact.
27    pub name: String,
28
29    /// The path to the artifact.
30    pub path: String,
31
32    /// The number of days to retain the artifact.
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub retention_days: Option<u32>,
35}