The git plugin as used in pipeline doesn't support ignoring commits from
certain users, or ignoring commits with certain messages.  Until it does,
you will probably need to "short circuit" and exit from the pipeline after
using git commands to extract the latest commit message from the
repository.  It's not a pretty solution, but it can work now.

Another alternative is to fork the git plugin and add the "ignore commits
from specific user" support to the pipeline.

Mark Waite

On Thu, Mar 23, 2017 at 7:43 AM Idan Adar <[email protected]> wrote:

> I should add that the job is of multibranch type.
>
>
> On Thursday, March 23, 2017 at 3:10:51 PM UTC+2, Idan Adar wrote:
>
> Hi all,
>
> In a declarative pipeline (a Jenkinsfile in the repo), how can I stop a
> job from getting re/triggered due to a push event in GitHub?
> For example:
>
> stage ("Publish to npm") {
>    steps {
>       sh '''
>          npm publish
>          npm --no-git-tag-version version minor
>       '''
>
>       sh '''
>          git commit -am 'Bumped version number'
>          git push
>       '''
>    }
> }
>
> The "git push" will trigger the push webhook in GitHub that makes a call
> to Jenkins, which will in turn start the same Jenkinsfile and again bump
> the version, commit, push and again... a loop.
> How can we not-trigger the job in this scenario?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/af0d3836-ae98-4e09-93bf-9dfa4d65b39f%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/af0d3836-ae98-4e09-93bf-9dfa4d65b39f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtHfc7jEz%2BoYG7sj3fQVuVq8BRrSeDyB1N1HwqKHD8E7Gg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to