gitlab-plugin icon indicating copy to clipboard operation
gitlab-plugin copied to clipboard

Jenkins job is triggered when approval is revoked.

Open jeffery opened this issue 4 years ago • 2 comments

Issue

When a Merge Request approval is revoked, Gitlab creates an event which is sent to Jenkins. When using the Approved Merge Requests (EE-only) trigger option, the Jenkins job triggers a build. I am trying to prevent this from happening.

When looking up the metadata which Gitlab sends to Jenkins, I see there is one particular key value that is being sent to Jenkins. This is the "action": "unapproved" within the "object_attributes" object.

Are we able to convert this value into an environment variable so we can skip the build? Or alternatively, do not allow Jenkins to trigger a job on this action (revoke approval)

Context

  • Gitlab plugin version: 1.5.13
  • Gitlab version: 13.1.4-ee
  • Jenkins version: 2.236
  • Job type: Pipeline

Problem description

Describe your problem in a meaningful way:

  • Revoke a Merge Request approval while using the Approved Merge Requests (EE-only) trigger option
  • Jenkins job should not trigger
  • Jenkins job is triggered

jeffery avatar Jul 20 '20 00:07 jeffery

Same here. Need an env variable to get the mr action in payload.

nofacer avatar Oct 08 '22 10:10 nofacer

Approve or revoke will trigger the build.

seagle0128 avatar Jul 03 '23 12:07 seagle0128