Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ Output Type - `console` (default), `file` or `both`.
`both` will output the coverage summary to the Action log and a file as above.


### `prfiles`

Only analyse added/changed files - string of filenames or false.


### `thresholds`

Lower and upper threshold percentages for badge and health indicators, lower threshold can also be used to fail the action. Separate the values with a space and enclose them in quotes; default `'50 75'`.
Expand Down
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Code Coverage Summary'
author: 'Irongut <murray.dave@outlook.com>'
description: 'A GitHub Action that reads Cobertura format code coverage files and outputs a text or markdown summary.'
name: 'Code Coverage Summary For Only Files In PR'
author: 'Irongut <murray.dave@outlook.com> forked by ChkltLabs <chkltlabs@gmail.com>'
description: 'Reads Cobertura format code coverage files and outputs a text or markdown summary, filterable to the current PR'
branding:
icon: book-open
color: purple
Expand Down Expand Up @@ -36,6 +36,10 @@ inputs:
description: 'Output Type - console (default), file or both.'
required: false
default: 'console'
prfiles:
description: 'Only analyse added/changed files - string or false.'
required: false
default: 'false'
thresholds:
description: 'Threshold percentages for badge and health indicators, lower threshold can also be used to fail the action.'
required: false
Expand Down
5 changes: 5 additions & 0 deletions src/CodeCoverageSummary/CommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public class CommandLineOptions
public string HideComplexityString { get; set; }

public bool HideComplexity => HideComplexityString.Equals("true", StringComparison.OrdinalIgnoreCase);

[Option(longName: "prfiles", Required = false, HelpText = "Only analyse added/changed files - string or false.", Default = "false")]
public string PRFilesOnlyString { get; set; }

public bool PRFilesOnly => !PRFilesOnlyString.Equals("false", StringComparison.OrdinalIgnoreCase);

[Option(longName: "indicators", Required = false, HelpText = "Include health indicators in the output - true or false.", Default = "true")]
public string IndicatorsString { get; set; }
Expand Down
7 changes: 7 additions & 0 deletions src/CodeCoverageSummary/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ private static int Main(string[] args)
return -2; // error
}
}

//if limiting to PR files, get list now
if (o.PRFilesOnly)
{
Console.WriteLine(o.PRFilesOnlyString);
return -2;
}

// parse code coverage file
CodeSummary summary = new();
Expand Down
Loading