Is there a way in JFrog Pipelines to automatically reject steps of a previous run which are still pending approval?

45 Views Asked by At

For example if run 1 is pending approval and run 2 is triggered, then run 1 should be rejected.

1

There are 1 best solutions below

0
On BEST ANSWER

The "Pending Approval" status comes specifically from the Approval Gates feature.

While you can't specifically reject a "pending approval" step when a new run is triggered, there is a very similar functionality that you can get by configuring the "cancelPendingRunsOn" flag in the GitRepo resource.

The idea with this flag is that you can have run 1 be cancelled when run 2 is triggered by commit or pull request from that repository. I think this gets you very close to the behavior you're asking about.

Here's a yml example for that setting:

- name: myRepo
  type: GitRepo
  configuration:
    gitProvider: myGitIntegration
    path: myorg/myrepo
    branches:
      include: {{gitBranch}}
    cancelPendingRunsOn:
      newCommit: true