From 35f601b6656ecdcd3ffbf008449d8e2ee5b1bed5 Mon Sep 17 00:00:00 2001 From: ArkadiuszMichalski <2730894+ArkadiuszMichalski@users.noreply.github.com> Date: Sun, 14 Apr 2024 23:35:36 +0200 Subject: [PATCH] Add ISSUE_TEMPLATE folder to exceptions ref: https://github.com/notepad-plus-plus/notepad-plus-plus/pull/14999#issuecomment-2054089871 Close #15002 --- .github/workflows/CI_build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI_build.yml b/.github/workflows/CI_build.yml index 2d7f4ddb9..5a5c238f3 100644 --- a/.github/workflows/CI_build.yml +++ b/.github/workflows/CI_build.yml @@ -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 }