diff --git a/.github/workflows/Shared-StaleBranch.yml b/.github/workflows/Shared-StaleBranch.yml
index aa2cddedd0b..90e84941947 100644
--- a/.github/workflows/Shared-StaleBranch.yml
+++ b/.github/workflows/Shared-StaleBranch.yml
@@ -305,6 +305,7 @@ jobs:
AheadBy = $AheadBy
BehindBy = $BehindBy
DaysSinceLastCommit = $($(Get-Date) - $LastCommitDate).Days
+ DaysSinceLastCommitOnDeleteDay = $($DeletionDate - $LastCommitDate).Days
ProcessingResult = $Null
BranchCreator = $BranchCreator
}
@@ -452,8 +453,8 @@ jobs:
# Branch processing has completed and, from this point on, reporting is generated.
# Construct the markdown table header that'll be used in the workflow summary.
- $TableHeaderRow1 = "| Branch name | Branch creator | Commits ahead by | Commits behind by | Days since last commit | Processing result |"
- $TableHeaderRow2 = "|-------------|----------------|------------------|-------------------|------------------------|-------------------|"
+ $TableHeaderRow1 = "| Branch name | Branch creator | Commits ahead by | Commits behind by | Days since last commit
(on $FriendlyDeletionDate) | Processing result |"
+ $TableHeaderRow2 = "|-------------|----------------|:----------------:|:-----------------:|:----------------------------------------------------:|-------------------|"
# Set job summary and create the "Deleted stale branches" section.
echo "# Stale branch results" >> $env:GITHUB_STEP_SUMMARY
@@ -507,6 +508,10 @@ jobs:
echo "The following branches will be deleted on **$FriendlyDeletionDate** because they will be over $MaxDaysBehind days behind the $DefaultBranch branch on that date. They also contain $MaxCommitsAhead or fewer commits not in the $DefaultBranch branch." >> $env:GITHUB_STEP_SUMMARY
echo "" >> $env:GITHUB_STEP_SUMMARY
+ echo "**Days since last commit** shows two values:" >> $env:GITHUB_STEP_SUMMARY
+ echo "- The number of days between the most recent commit and the date the workflow runs." >> $env:GITHUB_STEP_SUMMARY
+ echo "- The projected number of days between the most recent commit and the scheduled branch-deletion date, $FriendlyDeletionDate, shown in parentheses." >> $env:GITHUB_STEP_SUMMARY
+ echo "" >> $env:GITHUB_STEP_SUMMARY
echo "> [!IMPORTANT]" >> $env:GITHUB_STEP_SUMMARY
echo "> **If you don't want a branch to be deleted, merge $DefaultBranch into it before $FriendlyDeletionDate.**" >> $env:GITHUB_STEP_SUMMARY
echo "" >> $env:GITHUB_STEP_SUMMARY
@@ -527,11 +532,12 @@ jobs:
$AB = $BranchReport.AheadBy
$BB = $BranchReport.BehindBy
$LC = $BranchReport.DaysSinceLastCommit
+ $DD = $BranchReport.DaysSinceLastCommitOnDeleteDay
$PR = $BranchReport.ProcessingResult
$BC = $BranchReport.BranchCreator
- Write-Host "$PR`: Branch name: $BN. Branch creator: $BC. Ahead by: $AB. Behind by: $BB. Days since last commit: $LC. "
- echo "| $BN | [$BC]($GitHubBaseUrl/$BC) | $AB | $BB | $LC | $PR |" >> $env:GITHUB_STEP_SUMMARY
+ Write-Host "$PR`: Branch name: $BN. Branch creator: $BC. Ahead by: $AB. Behind by: $BB. Days since last commit: $LC. On $FriendlyDeletionDate`: ($DD)."
+ echo "| $BN | [$BC]($GitHubBaseUrl/$BC) | $AB | $BB | $LC
($DD) | $PR |" >> $env:GITHUB_STEP_SUMMARY
}
@@ -565,13 +571,14 @@ jobs:
$AB = $BranchReport.AheadBy
$BB = $BranchReport.BehindBy
$LC = $BranchReport.DaysSinceLastCommit
+ $DD = $BranchReport.DaysSinceLastCommitOnDeleteDay
$PR = $BranchReport.ProcessingResult
$BC = $BranchReport.BranchCreator
$BranchDiffHtmlUrl = "$($GitHubData.event.repository.html_url)/compare/$DefaultBranch...$($BN)#files_bucket"
- Write-Host "$PR`: Branch name: $BN. Branch creator: $BC. Ahead by: $AB. Behind by: $BB. Days since last commit: $LC. "
- echo "| [$BN]($BranchDiffHtmlUrl) | [$BC]($GitHubBaseUrl/$BC) | $AB | $BB | $LC | $PR |" >> $env:GITHUB_STEP_SUMMARY
+ Write-Host "$PR`: Branch name: $BN. Branch creator: $BC. Ahead by: $AB. Behind by: $BB. Days since last commit: $LC. On $FriendlyDeletionDate`: ($DD)."
+ echo "| [$BN]($BranchDiffHtmlUrl) | [$BC]($GitHubBaseUrl/$BC) | $AB | $BB | $LC
($DD) | $PR |" >> $env:GITHUB_STEP_SUMMARY
}