Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 3ffdf63

Browse files
BruceHaleymunozemilio
andauthored
Fix codecov.io report URL in build tag (#872)
* Use var system.pullRequest.sourceCommitId * Test new var Commit * Fix yml * Cleanup * Cleanup 2 * Add show env vars, conditionally tag with URL * Dummy change * Add Verify commit exists * Fix condition * Dynamically set CodecovUrl * Drop conditional on tag * Fix typo * Drop the get env vars task Co-authored-by: Emilio Munoz <[email protected]>
1 parent 534ff34 commit 3ffdf63

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

build/botframework-cli.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,22 @@ jobs:
4848
displayName: 'rush coverage -v'
4949

5050
- bash: 'bash <(curl -s https://codecov.io/bash)'
51-
displayName: 'push coverage report to codecov.io - https://codecov.io/github/microsoft/botframework-cli/commit/$(Build.SourceVersion)'
51+
displayName: 'push coverage report to codecov.io - https://codecov.io/github/microsoft/botframework-cli'
5252
env:
5353
CODECOV_TOKEN: $(TokenForCodecov)
5454

55+
- powershell: |
56+
# If commit Build.SourceVersion exists in Github, we can show a nicer codecov.io URL
57+
$result = $(git rev-list HEAD..$(Build.SourceVersion) 2>&1);
58+
if ($result -like "*fatal*") { $Url = "https://codecov.io/github/microsoft/botframework-cli" }
59+
else { $Url = "https://codecov.io/github/microsoft/botframework-cli/commit/$(Build.SourceVersion)" };
60+
Write-Host "##vso[task.setvariable variable=CodecovUrl;]$Url"
61+
displayName: 'Set CodecovUrl'
62+
5563
- task: colinsalmcorner.colinsalmcorner-buildtasks.tag-build-task.tagBuildOrRelease@0
5664
displayName: 'Tag Build with coverage url'
5765
inputs:
58-
tags: 'https://codecov.io/gh/microsoft/botframework-cli/tree/$(Build.SourceVersion)/packages'
66+
tags: '$(CodecovUrl)'
5967
continueOnError: true
6068

6169
- task: PublishCodeCoverageResults@1

0 commit comments

Comments
 (0)