Jenkins on Windows: polling log shows ignore message but job gets triggered

  github, jenkins, windows

I have basic freestyle job that is a github project. I have specified a branch (testing) and the trigger is "Poll SCM Schedule". I want to skip the job if a particular word (DONT) exists in commit message. If the commit is done directly to the specified branch it works, but in my case I do commits in other branch (***-project-setup) and merge it with testing via pull request and add the word (DONT) in extended description field, or leave a comment before merging.

The thing is that the Polling log shows that it has detected the word and is ignoring the build, but it also says Changes found and the build gets triggered and in the log I can see the same revision number (0c32d280ecd38b5dd254e1984aa9200eea8387c8 in this case) that was ignored according to Polling log

Polling log:

Fetching upstream changes from https://github.com/***/**.git
 > git.exe --version # timeout=10
 > git --version # 'git version 2.31.1.windows.1'
using GIT_ASKPASS to set credentials 
 > git.exe fetch --tags --force --progress -- https://github.com/***/***.git +refs/heads/*:refs/remotes/origin/* # timeout=10
Polling for changes in
 > git.exe rev-parse "refs/remotes/origin/testing^{commit}" # timeout=10
 > git.exe log --full-history --no-abbrev --format=raw -M -m 759a6cc040dc8fca2941c96f15d1b0c266e1d270..0c32d280ecd38b5dd254e1984aa9200eea8387c8 # timeout=10
Ignored commit 0c32d280ecd38b5dd254e1984aa9200eea8387c8: Found excluded message: Merge pull request #5 from ***/***-project-setup

14
DONT

Done. Took 1.8 sec
Changes found

Console output:

Fetching upstream changes from https://github.com/***/***.git
 > git.exe --version # timeout=10
 > git --version # 'git version 2.31.1.windows.1'
using GIT_ASKPASS to set credentials 
 > git.exe fetch --tags --force --progress -- https://github.com/***/***.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git.exe rev-parse "refs/remotes/origin/testing^{commit}" # timeout=10
Checking out Revision 0c32d280ecd38b5dd254e1984aa9200eea8387c8 (refs/remotes/origin/testing)
 > git.exe config core.sparsecheckout # timeout=10
 > git.exe checkout -f 0c32d280ecd38b5dd254e1984aa9200eea8387c8 # timeout=10
Commit message: "Merge pull request #5 from **/***-project-setup"
 > git.exe rev-list --no-walk 759a6cc040dc8fca2941c96f15d1b0c266e1d270 # timeout=10
[JenTest] $ powershell.exe -NonInteractive -ExecutionPolicy Bypass -File C:UsersADMINI~1AppDataLocalTempjenkins4694681890090278885.ps1
HI!!!!!!!!!!!!
Triggering a new build of test_env1
Finished: SUCCESS

Any suggestions? what do I do incorrectly?

Source: Windows Questions

LEAVE A COMMENT