Being able to have arbitrary run on branch deletion would allow cleanup of external artifacts that might be created by a pipeline (setting up staging environments for example).

          [JENKINS-37907] Include abililty to hook branch deletion.

          Travis Cline created issue -
          Travis Cline made changes -
          Description Original: Being able to hook branch deletion would allow cleanup of external artifacts that might be created by a pipeline (setting up staging environments for example). New: Being able to have arbitrary run on branch deletion would allow cleanup of external artifacts that might be created by a pipeline (setting up staging environments for example).
          Stephen Connolly made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Jesse Glick made changes -
          Link New: This issue relates to JENKINS-40606 [ JENKINS-40606 ]
          Peter Novotnak made changes -
          Component/s New: github-branch-source-plugin [ 20858 ]
          Michael Greco made changes -
          Comment [ I'd like to see this available from a GitHubOrg job ... when a Branch or PR is deleted I'd like to be able to run pipeline code on a different branch that then has instructions on removing infrastructure. Lets say all my repos in my orgs all have a special branch called "unprovision" which never goes away, and they all have a JenkinsFile called "JenkinsfileUnprovisionInfrastructure". So I set up GitHubOrg job to find all these projects and importantly I set the refspec to always checkout the "unprovision" branch. At this point the scan runs and discovery completes. Perfect. Now the idea is a person at some later point in Github does a BRANCH DELETE or PR CLOSE and in turn my GH webhook sends to Jenkins this event AND the GitHubOrg job gets the REMOVED event that comes in. My job then executes by checking out the branch identified in the refspec and runs the Jenkinsfile identified ... which cleans up the infrastructure related to a BRANCH and/or PR that has been closed. The idea is is when the development of something begins we provision infrastrcture from our pipelines ... SO WHEN ITS CLOSED WE NEED TO FREE UP THOSE RESOURCES and would like to do it from pipelines as well :) ]

            kohsuke Kohsuke Kawaguchi
            tmc Travis Cline
            Votes:
            0 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: