File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232
3333- ** unix:** Fix tests in Linux and macOS ([ #5179 ] ( https://github.com/ScoopInstaller/Scoop/issues/5179 ) )
3434- ** pester:** Update to Pester 5 ([ #5222 ] ( https://github.com/ScoopInstaller/Scoop/issues/5222 ) )
35+ - ** bucket:** Use BuildHelpers' EnvVars ([ #5226 ] ( https://github.com/ScoopInstaller/Scoop/issues/5226 ) )
3536
3637### Documentation
3738
Original file line number Diff line number Diff line change 11# Requires -Version 5.1
2+ # Requires -Modules @ { ModuleName = ' BuildHelpers' ; ModuleVersion = ' 2.0.1' }
23# Requires -Modules @ { ModuleName = ' Pester' ; ModuleVersion = ' 5.2.0' }
34param (
45 [String ] $BucketPath = $MyInvocation.PSScriptRoot
@@ -14,18 +15,8 @@ Describe 'Manifest validates against the schema' {
1415 $BucketPath
1516 }
1617 if ($env: CI -eq $true ) {
17- $commit = if ($env: GITHUB_SHA ) {
18- # GitHub Actions
19- $env: GITHUB_SHA
20- } elseif ($env: APPVEYOR_PULL_REQUEST_HEAD_COMMIT ) {
21- # AppVeyor
22- $env: APPVEYOR_PULL_REQUEST_HEAD_COMMIT
23- } else {
24- $env: APPVEYOR_REPO_COMMIT
25- }
26- if ($commit ) {
27- $changedManifests = @ (Get-GitChangedFile - Path $bucketDir - Include ' *.json' - Commit $commit )
28- }
18+ Set-BuildEnvironment - Force
19+ $changedManifests = @ (Get-GitChangedFile - Path $bucketDir - Include ' *.json' - Commit $env: BHCommitHash )
2920 }
3021 $manifestFiles = (Get-ChildItem $bucketDir - Filter ' *.json' - Recurse).FullName
3122 if ($changedManifests ) {
Original file line number Diff line number Diff line change @@ -26,17 +26,14 @@ if ($env:CI -eq $true) {
2626 Write-Host " Load 'BuildHelpers' environment variables ..."
2727 Set-BuildEnvironment - Force
2828
29- $commit = $env: BHCommitHash
30- $commitMessage = $env: BHCommitMessage
31-
3229 # Check if tests are called from the Core itself, if so, adding excludes
3330 if ($TestPath -eq (Convert-Path " $PSScriptRoot \.." )) {
34- if ($commitMessage -match ' !linter' ) {
31+ if ($env: BHCommitMessage -match ' !linter' ) {
3532 Write-Warning " Skipping code linting per commit flag '!linter'"
3633 $excludes += ' Linter'
3734 }
3835
39- $changedScripts = (Get-GitChangedFile - Include ' *.ps1' , ' *.psd1' , ' *.psm1' - Commit $commit )
36+ $changedScripts = (Get-GitChangedFile - Include ' *.ps1' , ' *.psd1' , ' *.psm1' - Commit $env: BHCommitHash )
4037 if (! $changedScripts ) {
4138 Write-Warning " Skipping tests and code linting for PowerShell scripts because they didn't change"
4239 $excludes += ' Linter'
You can’t perform that action at this time.
0 commit comments