Add ISSUE_TEMPLATE folder to exceptions

ref: https://github.com/notepad-plus-plus/notepad-plus-plus/pull/14999#issuecomment-2054089871

Close #15002
This commit is contained in:
ArkadiuszMichalski 2024-04-14 23:35:36 +02:00 committed by Don Ho
parent 045d21aa15
commit 35f601b665
1 changed files with 4 additions and 3 deletions

View File

@ -20,6 +20,7 @@ jobs:
run: |
$allowMaster = $true
$folders_onejob = "PowerEditor/(Test|(installer/(filesForTesting|functionList)))/"
$folders_nowork = "\.github/ISSUE_TEMPLATE"
$files_nowork = "md|txt|log|ini"
$files_needwork = "CMakeLists\.txt"
@ -34,13 +35,13 @@ jobs:
$commit_message = (git show -s --format=%B)
}
else {
$last_commit = @(Invoke-RestMethod ${{ github.event.pull_request._links.commits.href }})[0] | Select-Object -Last 1
$last_commit = @(Invoke-RestMethod ${{ github.event.pull_request._links.commits.href }})[0] | Select-Object -Last 1
$commit_message = $last_commit.commit.message
}
$commit_title = ($commit_message -split "[\r\n]+")[0]
$files_modified = @(git diff --name-only HEAD~1)
$files_needwork_all = @($files_modified | Where-Object {$_ -notmatch "\.(xml|$files_nowork)$|$folders_onejob" -or $_ -match "$files_needwork$"})
$files_needwork_all = @($files_modified | Where-Object {$_ -notmatch "\.(xml|$files_nowork)$|$folders_nowork|$folders_onejob" -or $_ -match "($files_needwork)$"})
if ($allowMaster -or !$isMaster) {
if ($commit_title -match "\[force all\]") {
@ -52,7 +53,7 @@ jobs:
Write-Output $matrix_onejob >> $env:GITHUB_OUTPUT
}
elseif (($files_modified.length -gt 0 -and $files_needwork_all.length -eq 0) -or $commit_title -match "\[force (xml|none)\]") {
if (@($files_modified | Where-Object {$_ -notmatch "\.($files_nowork)$"}).length -eq 0 -or $commit_title -match "\[force none\]") {
if (@($files_modified | Where-Object {$_ -notmatch "\.($files_nowork)$|$folders_nowork"}).length -eq 0 -or $commit_title -match "\[force none\]") {
Write-Output "Changed files on this commit don't require any additional tasks.`n"
Write-Output "result=OK" >> $env:GITHUB_OUTPUT
}