Skip to content

Commit 10f2739

Browse files
authored
Merge pull request #66 from DeveloperMetrics/samsmithnz-patch-1
Update deploymentfrequency.ps1
2 parents 9ddf79c + de158ed commit 10f2739

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/deploymentfrequency.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ function Main ([string] $ownerRepo,
8181
}
8282

8383
#==========================================
84-
#Filter out workflows that were successful. Measure the number by date/day. Aggegate workflows together
84+
#Filter to workflows that were successful. Measure the number by date/day. Aggegate workflows together
8585
$dateList = @()
8686
$uniqueDates = @()
8787
$deploymentsPerDayList = @()
8888

8989
#For each workflow id, get the last 100 workflows from github
9090
Foreach ($workflowId in $workflowIds){
9191
#Get workflow definitions from github
92-
$uri2 = "https://api.github.com/repos/$owner/$repo/actions/workflows/$workflowId/runs?per_page=100&status=completed"
92+
$uri2 = "https://api.github.com/repos/$owner/$repo/actions/workflows/$workflowId/runs?per_page=100&status=success"
9393
if (!$authHeader)
9494
{
9595
$workflowRunsResponse = Invoke-RestMethod -Uri $uri2 -ContentType application/json -Method Get -SkipHttpErrorCheck -StatusCodeVariable "HTTPStatus"
@@ -101,7 +101,7 @@ function Main ([string] $ownerRepo,
101101

102102
$buildTotal = 0
103103
Foreach ($run in $workflowRunsResponse.workflow_runs){
104-
#Count workflows that are completed, on the target branch, and were created within the day range we are looking at
104+
#Count workflows that are successfully completed, on the target branch, and were created within the day range we are looking at
105105
if ($run.head_branch -eq $branch -and $run.created_at -gt (Get-Date).AddDays(-$numberOfDays))
106106
{
107107
#Write-Host "Adding item with status $($run.status), branch $($run.head_branch), created at $($run.created_at), compared to $((Get-Date).AddDays(-$numberOfDays))"

0 commit comments

Comments
 (0)