Search code examples
jfrog-pipelines

Jfrog pipelines - how to cancel runs on repository updates?


Is there a way to cancel my active existing pipeline runs whenever a change is pushed to my repository?


Solution

  • Yes, you can set cancelPendingRunsOn for the triggarable GitRepo resources in order to cancel all the previous runs.

    For example:

    resources:
      - name: my_app_repo
        type: GitRepo
        configuration:
          gitProvider: my_github
          path: myuser/repo-name
          branches:
            include: master
          cancelPendingRunsOn:
            newCommit: true
            pullRequestUpdate: true
    

    You can enable this variable for new commit and also for pullRequest update. Please refer this documentation for more information https://www.jfrog.com/confluence/display/JFROG/GitRepo