Skip to content

Commit a77902a

Browse files
authored
[1ES] Add 1ES pipeline files (#10096)
1 parent 9900499 commit a77902a

22 files changed

+911
-22
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ TestResults/
3030

3131
local.settings.json
3232
msbuild.binlog
33+
pp.xml
3334
BenchmarkDotNet.Artifacts/

.sccignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.sscignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "cfs": [ "CFS0001", "CFS0013", "CFS0031" ] }

Directory.Build.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
<Project>
22

3+
<!-- artifacts -->
34
<PropertyGroup>
45
<ArtifactsPath>$(MSBuildThisFileDirectory)out</ArtifactsPath>
56
<ArtifactsPublishOutputName>pub</ArtifactsPublishOutputName>
67
<ArtifactsPackageOutputName>pkg</ArtifactsPackageOutputName>
78
</PropertyGroup>
89

10+
<!-- paths -->
11+
<PropertyGroup>
12+
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
13+
<EngRoot>$(RepoRoot)eng/</EngRoot>
14+
</PropertyGroup>
15+
916
</Project>

Directory.Build.targets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project>
2+
3+
<Import Project="$(EngRoot)build/Engineering.targets" />
4+
5+
</Project>

build/Get-AzureFunctionsVersion.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ function Get-AzureFunctionsVersion {
1717
$version = (& dotnet $cmd).Trim()
1818

1919
return $version
20-
}
20+
}

build/check-vulnerabilities.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ if (!$result)
2121
{
2222
Write-Host "Vulnerabilities found"
2323
Exit 1
24-
}
24+
}

build/common.props

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
<Message Importance="high" Text="$(Version)" />
4141
</Target>
4242

43-
<ItemGroup>
44-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
45-
</ItemGroup>
46-
4743
<ItemGroup>
4844
<AdditionalFiles Include="$(MSBuildThisFileDirectory)..\stylecop.json" Link="stylecop.json" />
4945
</ItemGroup>

build/initialize-pipeline.ps1

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ param (
44

55
$buildReason = $env:BUILD_REASON
66
$sourceBranch = $env:BUILD_SOURCEBRANCH
7+
$provider = $env:BUILD_REPOSITORY_PROVIDER
78

89
Write-Host "BUILD_REASON: '$buildReason'"
910
Write-Host "BUILD_SOURCEBRANCH: '$sourceBranch'"
@@ -15,15 +16,18 @@ if ($buildReason -eq "PullRequest") {
1516
# This often gets rate limited, so it isn't reliable.
1617

1718
$pack = $false
18-
try {
19-
$response = Invoke-RestMethod api.github.com/repos/$env:BUILD_REPOSITORY_ID/pulls/$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
20-
$title = $response.title.ToLowerInvariant()
21-
Write-Host "Pull request '$title'"
22-
$pack = $title.Contains("[pack]")
23-
}
24-
catch {
25-
Write-Warning "Failed to get pull request title."
26-
Write-Warning $_
19+
20+
if ($provider -eq "GitHub") {
21+
try {
22+
$response = Invoke-RestMethod api.github.com/repos/$env:BUILD_REPOSITORY_ID/pulls/$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
23+
$title = $response.title.ToLowerInvariant()
24+
Write-Host "Pull request '$title'"
25+
$pack = $title.Contains("[pack]")
26+
}
27+
catch {
28+
Write-Warning "Failed to get pull request title."
29+
Write-Warning $_
30+
}
2731
}
2832

2933
# Next we check if the commit message contains '--pack'

eng/build/Engineering.targets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project>
2+
3+
<Import Project="$(MSBuildThisFileDirectory)RepositoryInfo.targets" />
4+
5+
</Project>

0 commit comments

Comments
 (0)