mirror of
https://github.com/actions/runner-images.git
synced 2025-12-18 07:46:57 +00:00
removed relative path
This commit is contained in:
@@ -9,14 +9,13 @@ function Validate-Scripts {
|
|||||||
)
|
)
|
||||||
$ScriptWithoutShebangLine = @()
|
$ScriptWithoutShebangLine = @()
|
||||||
Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object {
|
Get-ChildItem $path -Recurse -File -Filter "*.sh" | ForEach-Object {
|
||||||
$RelativePath = Join-Path $Path $($_.Name)
|
$shebangLine = Get-Content -Path $($_.FullName)| Select-Object -First 1
|
||||||
$shebangLine = Get-Content -Path $RelativePath | Select-Object -First 1
|
|
||||||
if ($shebangLine -eq $ExpectedShebang) {
|
if ($shebangLine -eq $ExpectedShebang) {
|
||||||
Write-Host "Pattern '$ExpectedShebang' found in '$RelativePath'"
|
Write-Host "Pattern '$ExpectedShebang' found in '$($_.FullName)'"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write-Host "Pattern '$ExpectedShebang' not found in '$RelativePath'"
|
Write-Host "Pattern '$ExpectedShebang' not found in '$($_.FullName)'"
|
||||||
$ScriptWithoutShebangLine += $RelativePath
|
$ScriptWithoutShebangLine += $($_.FullName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $ScriptWithoutShebangLine
|
return $ScriptWithoutShebangLine
|
||||||
|
|||||||
Reference in New Issue
Block a user