Skip to content

Commit 9c49fa8

Browse files
authored
Merge branch 'PowerShell:master' into master
2 parents b93490c + ed6e058 commit 9c49fa8

371 files changed

Lines changed: 19053 additions & 7723 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Windows PowerShell
4-
url: https://windowsserver.uservoice.com/forums/301869-powershell
4+
url: https://support.microsoft.com/windows/send-feedback-to-microsoft-with-the-feedback-hub-app-f59187f8-8739-22d6-ba93-f66612949332
55
about: Windows PowerShell issues or suggestions.
66
- name: Support
77
url: https://github.com/PowerShell/PowerShell/blob/master/.github/SUPPORT.md

.github/prquantifier.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# https://github.com/microsoft/PullRequestQuantifier/blob/main/docs/prquantifier-yaml.md
2+
Excluded:
3+
# defaults
4+
- '*.csproj'
5+
- prquantifier.yaml
6+
- package-lock.json
7+
- '*.md'
8+
- '*.sln'
9+
# autogenerated files
10+
- tools/cgmanifest.json
11+
- assets/wix/files.wxs
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
function Set-GWVariable {
5+
param(
6+
[Parameter(Mandatory = $true)]
7+
[string]$Name,
8+
[Parameter(Mandatory = $true)]
9+
[string]$Value
10+
)
11+
12+
Write-Verbose "Setting CI variable $Name to $Value" -Verbose
13+
14+
if ($env:GITHUB_ENV) {
15+
"$Name=$Value" | Out-File $env:GITHUB_ENV -Append
16+
}
17+
}
18+
19+
function Get-GWTempPath {
20+
$temp = [System.IO.Path]::GetTempPath()
21+
if ($env:RUNNER_TEMP) {
22+
$temp = $env:RUNNER_TEMP
23+
}
24+
25+
Write-Verbose "Get CI Temp path: $temp" -Verbose
26+
return $temp
27+
}

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
jobs:
1818
analyze:
1919
name: Analyze
20-
runs-on: ubuntu-16.04
20+
runs-on: ubuntu-18.04
2121

2222
strategy:
2323
fail-fast: false

.github/workflows/daily.yml

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,69 @@ jobs:
3030
git fetch --prune --unshallow --tags
3131
- name: Execute Update .NET script
3232
run: |
33+
Import-Module ./.github/workflows/GHWorkflowHelper
3334
$currentVersion = (Get-Content .\global.json | ConvertFrom-Json).sdk.version
34-
Write-Verbose "OLD_VERSION=$currentVersion" -Verbose
35-
"OLD_VERSION=$currentVersion" | Out-File $env:GITHUB_ENV -Append
35+
Set-GWVariable -Name OLD_VERSION -Value $currentVersion
3636
37-
./tools/UpdateDotnetRuntime.ps1 -UpdateMSIPackaging
37+
./tools/UpdateDotnetRuntime.ps1 -UpdateMSIPackaging -UseInternalFeed
3838
$newVersion = (Get-Content .\global.json | ConvertFrom-Json).sdk.version
39-
Write-Verbose "NEW_VERSION=$newVersion" -Verbose
40-
"NEW_VERSION=$newVersion" | Out-File $env:GITHUB_ENV -Append
39+
Set-GWVariable -Name NEW_VERSION -Value $newVersion
4140
4241
if ($currentVersion -ne $newVersion) {
43-
Write-Verbose "CREATE_PR=true" -Verbose
44-
"CREATE_PR=true" | Out-File $env:GITHUB_ENV -Append
42+
Set-GWVariable -Name CREATE_PR -Value 'true'
4543
}
44+
- name: Microsoft Teams Notifier
45+
uses: skitionek/notify-microsoft-teams@master
46+
if: failure()
47+
with:
48+
webhook_url: ${{ secrets.PS_BUILD_TEAMS_CHANNEL }}
49+
overwrite: "{title: `Failure in updating .NET build. Look at ${workflow_link}`}"
4650
- name: Create Pull Request
47-
uses: peter-evans/create-pull-request@v2
51+
uses: peter-evans/create-pull-request@v3
4852
id: cpr
4953
if: env.CREATE_PR == 'true'
5054
with:
5155
commit-message: "Update .NET SDK version from `${{ env.OLD_VERSION }}` to `${{ env.NEW_VERSION }}`"
5256
title: "Update .NET SDK version from `${{ env.OLD_VERSION }}` to `${{ env.NEW_VERSION }}`"
5357
base: master
5458
branch: dotnet_update
55-
56-
59+
update-tpn:
60+
name: Update Notices File
61+
timeout-minutes: 15
62+
runs-on: windows-latest
63+
if: github.repository == 'PowerShell/PowerShell'
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v2
67+
- name: Update Notices file
68+
run: |
69+
Invoke-WebRequest -Uri https://aka.ms/pwsh-daily-tpn -OutFile ./ThirdPartyNotices.txt
70+
- name: Capture Git Status
71+
run: |
72+
git status --short
73+
- name: Check if we need to create a PR
74+
run: |
75+
$ErrorActionPreference = 'continue'
76+
git diff --quiet ThirdPartyNotices.txt
77+
$exitCode = $LASTEXITCODE
78+
Write-Verbose -Message "Exit code: $exitCode" -Verbose
79+
if ($LASTEXITCODE -ne 0) {
80+
Import-Module ./.github/workflows/GHWorkflowHelper
81+
Set-GWVariable -Name CREATE_PR -Value 'true'
82+
} else {
83+
Write-Verbose "No difference found. Not creating a PR." -Verbose
84+
}
85+
exit 0
86+
- name: Create Pull Request
87+
uses: peter-evans/create-pull-request@v3
88+
id: cprtpn
89+
if: env.CREATE_PR == 'true'
90+
with:
91+
commit-message: "Update to the latest notice file"
92+
committer: GitHub <noreply@github.com>
93+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
94+
title: "Update to the latest notice file"
95+
reviewers: travisez13
96+
base: master
97+
draft: false
98+
branch: update-cgmanifest
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT license.
3+
4+
name: Update cgmanifest
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
branches:
9+
- master
10+
11+
defaults:
12+
run:
13+
shell: pwsh
14+
15+
env:
16+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
17+
POWERSHELL_TELEMETRY_OPTOUT: 1
18+
CGMANIFEST_PATH: ''
19+
NUGET_PACKAGES: ${{ github.workspace }}\.nuget\packages
20+
21+
jobs:
22+
update-cgmanifest:
23+
name: Update cgmanifest
24+
timeout-minutes: 15
25+
runs-on: windows-latest
26+
if: github.repository == 'PowerShell/PowerShell'
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v2
30+
- name: Cache DotNet
31+
uses: actions/cache@v2
32+
with:
33+
path: |
34+
~\AppData\Local\Microsoft\dotnet
35+
${{ github.workspace }}\.nuget\packages
36+
key: ${{ runner.os }}-${{ hashFiles('**\DotnetRuntimeMetadata.json') }}-${{ hashFiles('**\nuget.config') }}
37+
- name: Sync tags
38+
run: |
39+
git fetch --prune --unshallow --tags
40+
- name: Install Ships provider to deal with project.assets.json
41+
run: |
42+
Install-Module -Name dotnet.project.assets -force
43+
- name: Bootstrap
44+
run: |
45+
Import-Module ./build.psm1
46+
Start-PSBootStrap
47+
- name: Verify cgmanifest is up to date
48+
run: |
49+
Import-Module ./build.psm1
50+
Find-Dotnet
51+
./tools/findMissingNotices.ps1
52+
- name: Upload cgmanifest
53+
uses: actions/upload-artifact@v2
54+
if: always() && env.CGMANIFEST_PATH != ''
55+
with:
56+
name: cgmanifest
57+
path: ${{ env.CGMANIFEST_PATH }}

.globalconfig

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ dotnet_diagnostic.CA1065.severity = warning
198198
dotnet_diagnostic.CA1066.severity = none
199199

200200
# CA1067: Override Object.Equals(object) when implementing IEquatable<T>
201-
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1067
202-
dotnet_diagnostic.CA1067.severity = suggestion
201+
# # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1067
202+
dotnet_diagnostic.CA1067.severity = warning
203203

204204
# CA1068: CancellationToken parameters must come last
205205
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1068
@@ -506,6 +506,10 @@ dotnet_diagnostic.CA1845.severity = warning
506506
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1846
507507
dotnet_diagnostic.CA1846.severity = warning
508508

509+
# CA1847: Use char literal for a single character lookup
510+
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1847
511+
dotnet_diagnostic.CA1847.severity = warning
512+
509513
# CA2000: Dispose objects before losing scope
510514
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2000
511515
dotnet_diagnostic.CA2000.severity = none
@@ -704,6 +708,10 @@ dotnet_diagnostic.CA2250.severity = warning
704708
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2251
705709
dotnet_diagnostic.CA2251.severity = warning
706710

711+
# CA2252: This API requires opting into preview features
712+
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2252
713+
dotnet_diagnostic.CA2251.severity = none
714+
707715
# CA2300: Do not use insecure deserializer BinaryFormatter
708716
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2300
709717
dotnet_diagnostic.CA2300.severity = none

0 commit comments

Comments
 (0)