Skip to content

Commit

Permalink
Add total commits to check output (#13)
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Castaño Arteaga <[email protected]>
  • Loading branch information
tegioz authored Aug 31, 2024
1 parent 1b3ec53 commit 288f817
Show file tree
Hide file tree
Showing 2 changed files with 249 additions and 125 deletions.
8 changes: 6 additions & 2 deletions dco2/src/dco/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ pub struct CheckInput {
}

/// Check output.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, Template)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Template)]
#[template(path = "output.md")]
pub struct CheckOutput {
pub commits_with_errors: Vec<CommitCheckOutput>,
pub total_commits: usize,
}

/// Commit check output.
Expand Down Expand Up @@ -126,7 +127,10 @@ pub async fn process_event(gh_client: DynGHClient, event: &Event) -> Result<()>

/// Run DCO check.
pub fn check(input: &CheckInput) -> CheckOutput {
let mut output = CheckOutput::default();
let mut output = CheckOutput {
commits_with_errors: Vec::new(),
total_commits: input.commits.len(),
};

// Check each commit
for commit in &input.commits {
Expand Down
Loading

0 comments on commit 288f817

Please sign in to comment.