Skip to content

Commit e7ea62f

Browse files
authored
Merge pull request #13819 from MicrosoftDocs/workflows-test
Remove branch creator, add branch view link, in delete table
2 parents 3c0e7bc + cc18f0d commit e7ea62f

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

.github/workflows/Shared-StaleBranch.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,12 @@ jobs:
452452
#######
453453
# Branch processing has completed and, from this point on, reporting is generated.
454454

455-
# Construct the markdown table header that'll be used in the workflow summary.
456-
$TableHeaderRow1 = "| Branch name | Branch creator | Commits ahead by | Commits behind by | Days since last commit<br>(on $FriendlyDeletionDate) | Processing result |"
457-
$TableHeaderRow2 = "|-------------|----------------|:----------------:|:-----------------:|:----------------------------------------------------:|-------------------|"
455+
# Construct the markdown table headers that'll be used in the workflow summary.
456+
$DeleteTableHeaderRow1 = "| Branch name | Commits ahead by | Commits behind by | Days since last commit<br>(on $FriendlyDeletionDate) | Processing result |"
457+
$DeleteTableHeaderRow2 = "|-------------|:----------------:|:-----------------:|:----------------------------------------------------:|-------------------|"
458+
459+
$WatchTableHeaderRow1 = "| Branch name | Branch creator | Commits ahead by | Commits behind by | Days since last commit<br>(on $FriendlyDeletionDate) | Processing result |"
460+
$WatchTableHeaderRow2 = "|-------------|----------------|:----------------:|:-----------------:|:----------------------------------------------------:|-------------------|"
458461

459462
# Set job summary and create the "Deleted stale branches" section.
460463
echo "# Stale branch results" >> $env:GITHUB_STEP_SUMMARY
@@ -519,8 +522,8 @@ jobs:
519522
}
520523

521524
# Start to build the branch action taken table in the workflow summary.
522-
echo $TableHeaderRow1 >> $env:GITHUB_STEP_SUMMARY
523-
echo $TableHeaderRow2 >> $env:GITHUB_STEP_SUMMARY
525+
echo $DeleteTableHeaderRow1 >> $env:GITHUB_STEP_SUMMARY
526+
echo $DeleteTableHeaderRow2 >> $env:GITHUB_STEP_SUMMARY
524527

525528

526529
# Loop through every reporting object in the array where the processing result isn't "Watch". Add a row for each branch
@@ -537,7 +540,18 @@ jobs:
537540
$BC = $BranchReport.BranchCreator
538541

539542
Write-Host "$PR`: Branch name: $BN. Branch creator: $BC. Ahead by: $AB. Behind by: $BB. Days since last commit: $LC. On $FriendlyDeletionDate`: ($DD)."
540-
echo "| $BN | [$BC]($GitHubBaseUrl/$BC) | $AB | $BB | $LC<br>($DD) | $PR |" >> $env:GITHUB_STEP_SUMMARY
543+
544+
If ($DeletionRun) {
545+
546+
echo "| $BN | $AB | $BB | $LC<br>($DD) | $PR |" >> $env:GITHUB_STEP_SUMMARY
547+
548+
} Else {
549+
550+
$BranchViewUrl = "$($GitHubData.event.repository.html_url)/branches/all?query=$BN"
551+
552+
echo "| [$BN]($BranchViewUrl) | $AB | $BB | $LC<br>($DD) | $PR |" >> $env:GITHUB_STEP_SUMMARY
553+
554+
}
541555

542556
}
543557

@@ -559,8 +573,8 @@ jobs:
559573
echo "These branches should be reviewed and, if they're no longer needed, deleted. If these branches are still needed, they must be brought up to date with the $DefaultBranch branch. Select a branch name to view the differences between it and $($DefaultBranch)." >> $env:GITHUB_STEP_SUMMARY
560574
echo "**Branches in this list may be deleted at a future date even if they contain commits not in the $DefaultBranch branch.**" >> $env:GITHUB_STEP_SUMMARY
561575
echo "" >> $env:GITHUB_STEP_SUMMARY
562-
echo $TableHeaderRow1 >> $env:GITHUB_STEP_SUMMARY
563-
echo $TableHeaderRow2 >> $env:GITHUB_STEP_SUMMARY
576+
echo $WatchTableHeaderRow1 >> $env:GITHUB_STEP_SUMMARY
577+
echo $WatchTableHeaderRow2 >> $env:GITHUB_STEP_SUMMARY
564578

565579
# Loop through every reporting object in the array where the processing result is "Watch". Add a row for each branch
566580
# containing the branch data for writers to review. This is the table that shows writers which branches might be deleted in the future.

0 commit comments

Comments
 (0)