Giter VIP home page Giter VIP logo

Comments (9)

tomasbjerre avatar tomasbjerre commented on May 22, 2024

Here is an example that triggers if the user is not "jenkins":

https://github.com/jenkinsci/generic-webhook-trigger-plugin/blob/master/src/test/java/org/jenkinsci/plugins/gwt/GenericTriggerTest.java#L37

from generic-webhook-trigger-plugin.

kdeenkhoorn avatar kdeenkhoorn commented on May 22, 2024

Weird, if i use ^((?!BUILD_USER))$ it does not work.
If i use ^((?!BUILD_USER).)*$ it works.
What is the diference ?

My variable contains ACTOR = "MY_NAME"

Logging:

Triggering GenericTrigger [genericVariables=[GenericVariable [expressionType=JSONPath, key=ID, value=$.pullRequest.id, regexpFilter=], GenericVariable [expressionType=JSONPath, key=ACTOR, value=$.actor.name, regexpFilter=]], regexpFilterText=$ACTOR, regexpFilterExpression=^((?!iBUILD_USER))$, genericRequestVariables=null]
Mar 22, 2018 11:28:20 AM INFO org.jenkinsci.plugins.gwt.GenericTrigger isMatching
Not triggering "^((?!iBUILD_USER))$" not matching "My_NAME".

Thanks in advance.

from generic-webhook-trigger-plugin.

kdeenkhoorn avatar kdeenkhoorn commented on May 22, 2024

Forgot to mention, the plugin version is 1.10 on Jenkins 2.60.1

from generic-webhook-trigger-plugin.

tomasbjerre avatar tomasbjerre commented on May 22, 2024

Perhaps remove the $ at the end of regexp or move it inside the parenthesis.

from generic-webhook-trigger-plugin.

ximbal avatar ximbal commented on May 22, 2024

So you are saying that if I set the username of the user committing to "Jenkins" it will ignore it and skip the build????, if so, that is exactly the behavior I am trying to achieve.

from generic-webhook-trigger-plugin.

tomasbjerre avatar tomasbjerre commented on May 22, 2024

It is all about the json string. if "set the username of the user " means you change the json being sent, then yes.

You should continue this discussion in the issue you originally created. Closing this one as the reporter dos not respond.

from generic-webhook-trigger-plugin.

kdeenkhoorn avatar kdeenkhoorn commented on May 22, 2024

Hi, due to courses and work i was not able to answer in time. It seems that ^((?!BUILD_USER).)*$ is the only thing that works for me. Have tried different notations also the one 'hidden' in your code but i can not get that notation to work. This solution is fine for me at this moment. Thanks for the support.

Kl@@s

from generic-webhook-trigger-plugin.

tomasbjerre avatar tomasbjerre commented on May 22, 2024

I added a test case for this. If someone needs it in the future:
https://github.com/jenkinsci/generic-webhook-trigger-plugin/blob/master/src/test/resources/org/jenkinsci/plugins/gwt/bdd/github/github-push-trigger-unless-specific-user.feature

from generic-webhook-trigger-plugin.

kdeenkhoorn avatar kdeenkhoorn commented on May 22, 2024

Thanks for the quick support, keep up the good work!

from generic-webhook-trigger-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.