@@ -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
0 commit comments