Jenkins: Don't want to trigger on Git Tag (No Workspace)

I have users who need to trigger jenkins jobs on Github (Enterprise) pushes. So all I have access to are Webhooks, and the Git Service hooks. These hooks push even if the only commit was a tag.

Some users auto-tag their builds if they succeed, this auto-tag causes a new webhook to fire and it triggers their build again.

  • WSO2 API Manager response fails with APIMgtGoogleAnalyticsTrackingHandler error
  • How can I know why Docker container stopped?
  • Building a Docker Image with rstan on rocker/verse
  • App running on docker consuming page cache of host machine.Is that anti-pattern ?
  • View Tensorboard via Chorme on Windows
  • deploy docker container on AWS EC2 instance without being logged in
  • Typically we were avoiding this by using the git plugins “exclude user” section and setting a list of service accounts on that list that do the tagging.

    However with the advent of our new ephemeral build farm, we don’t maintain workspaces anymore (we spin nodes up as Docker containers on demand). So this approach no longer works (see:

    My temporary work around is that I run a shell script as the first build step which now does some git-log compares and aborts the build if the service account was the only committer.

    I’m looking for a way to use a git hook to trigger a build that does not even start the build if it was just a tag event.

    This would appear to be an a difficult ask, but I feel like this problem has to be pretty common. Many people must auto-tag Git after a build runs successfully and avoid rebuilding.

  • Docker Hub automated build failure. Local build is fine
  • Auth0 OWIN API not validating JWT token when published via Docker Container on AWS EC2
  • Error unmounting Docker - invalid argument
  • Unable to login into private docker registry (v2.0)
  • Ignoring subfolders not working
  • Remove local Docker images on macOS
  • One Solution collect form web for “Jenkins: Don't want to trigger on Git Tag (No Workspace)”

    I know this question is getting old, but I recently had a similar problem with Bitbucket’s webhook to Jenkins that would send out notifications of push changes for tags. I tried configuring the hook not to send those, but it never worked.

    After much trial and error, the only thing that worked for me was to set the “Branch Specifier (blank for ‘any’)” field of the Jenkins Git Plugin to “everything but tags”, using a regex like this one: :^(?!.*(refs\/tags\/)).*.

    I admit that this solution has the major drawback that a job with such a configuration cannot build tags… In my case, the set of jobs that had this configuration wasn’t expected to build tags, so it was an okay solution, but I would have much preferred to remove the notifications.

    Hope this helps.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.