Skip to content

Commit 4602904

Browse files
committed
Fix lint root resolution and Syft artifact upload
1 parent 2987fac commit 4602904

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ jobs:
168168
path: ./
169169
format: 'cyclonedx-json'
170170
output-file: 'sbom.json'
171+
upload-artifact: false
171172

172173
- name: Upload SBOM as artifact
173174
uses: actions/upload-artifact@v4

tools/lint.ps1

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,21 @@ function Ensure-PSScriptAnalyzer {
2222
}
2323

2424
function Get-RepositoryRoot {
25-
$scriptRoot = Split-Path -Path $MyInvocation.MyCommand.Path -Parent
26-
return (Resolve-Path -Path (Join-Path -Path $scriptRoot -ChildPath '..')).Path
25+
$scriptRoot = if ($PSScriptRoot) {
26+
$PSScriptRoot
27+
}
28+
elseif ($PSCommandPath) {
29+
Split-Path -Path $PSCommandPath -Parent
30+
}
31+
elseif ($MyInvocation.MyCommand.Path) {
32+
Split-Path -Path $MyInvocation.MyCommand.Path -Parent
33+
}
34+
else {
35+
throw 'Unable to determine lint.ps1 location.'
36+
}
37+
38+
$rootPath = Join-Path -Path $scriptRoot -ChildPath '..'
39+
return (Resolve-Path -Path $rootPath).Path
2740
}
2841

2942
function Get-FormatterTargets {

0 commit comments

Comments
 (0)