-
Notifications
You must be signed in to change notification settings - Fork 11
/
azure-pipelines-13.yml
51 lines (38 loc) · 1.38 KB
/
azure-pipelines-13.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# https://stackoverflow.com/questions/64168812/extract-files-to-process-no-files-were-found-warning
trigger: none
pr: none
pool:
vmImage: 'ubuntu-latest'
variables:
devopsAccount : 'thecodemanual'
projectName : 'DevOps Manual'
logId: "6"
steps:
- task: ExtractFiles@1
displayName: 'Extract files '
inputs:
archiveFilePatterns: '$(System.ArtifactsDirectory)\*.zip'
destinationFolder: '$(System.ArtifactsDirectory)\bin'
- task: PowerShell@2
name: testDetails
condition: always()
inputs:
targetType: 'inline'
script: |
# Encode the Personal Access Token (PAT)
$AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$(System.AccessToken)")) }
# Get a list of releases
$uri = "https://dev.azure.com/$(devopsAccount)/$(projectName)/_apis/build/builds/$(Build.BuildId)/logs/$(logId)?api-version=5.1"
Write-Host $uri
# Invoke the REST call
$result = Invoke-RestMethod -Uri $uri -Method Get -Headers $AzureDevOpsAuthenicationHeader
Write-Host $result
$lines = $result.Split([Environment]::NewLine)
$passed = 0;
$failed = 0;
foreach($line in $lines) {
if ($line -match "Found: 0 files to extract") {
throw 'There is no files to extract'
exit 1
}
}