Skip to content

Commit

Permalink
Merge pull request #9085 from Azure/filter-exclusion-list
Browse files Browse the repository at this point in the history
Filter out exclusion list so that package is not created
  • Loading branch information
v-amolpatil authored Sep 26, 2023
2 parents b6d8d64 + f7b908f commit 255afa2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .script/package-automation/getSolutionName.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ try
$filteredFiles = $diff | Where-Object {$_ -match "Solutions/"} | Where-Object {$_ -notlike "Solutions/Images/*"} | Where-Object {$_ -notlike "Solutions/*.md"} | Where-Object { $_ -notlike '*system_generated_metadata.json' }
Write-Host "Filtered Files $filteredFiles"

# IDENTIFY EXCLUSIONS AND IF THERE ARE NO FILES AFTER EXCLUSION THEN SKIP WORKFLOW RUN
$exclusionList = @(".py$",".png$",".jpg$",".jpeg$",".conf$", ".svg$", ".html$", ".ps1$", ".psd1$", "requirements.txt$", "host.json$", "proxies.json$", "/function.json$", ".xml$", ".zip$", ".md$")

$filterOutExclusionList = $filteredFiles | Where-Object { $_ -notmatch ($exclusionList -join '|') }

if ($filterOutExclusionList.Count -le 0)
{
Write-Host "Skipping GitHub Action as changes in PR are not valid and contains only excluded files!"
Write-Output "solutionName=" >> $env:GITHUB_OUTPUT
exit 0
}

if ($filteredFiles.Count -gt 0)
{
if ($instrumentationKey -ne '')
Expand Down

0 comments on commit 255afa2

Please sign in to comment.