Created
September 30, 2015 08:04
-
-
Save jechlin/6cde257fb6ec48007dc2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.atlassian.stash.event.pull.PullRequestMergeActivityEvent | |
import com.atlassian.stash.pull.PullRequestAction | |
def event = event as PullRequestMergeActivityEvent | |
if (event.action != PullRequestAction.MERGED) { | |
// not a merge, we don't care about this event so return false | |
return false | |
} | |
def fromRef = event.pullRequest.fromRef // branch ref that is the pull request source branch | |
// pull request source branch is one we care about? | |
def branchesMatch = fromRef.id.startsWith("refs/heads/ZuoraPanda3") || fromRef.id.startsWith("refs/heads/release/") | |
// does the PR make changes to paths we care about? | |
def pathsMatch = event.pullRequest.pathsMatch('glob:build/template/') || event.pullRequest.pathsMatch('glob:build/deploytypes/') | |
// condition returns true if both source branch is interesting, and paths is interesting | |
return branchesMatch && pathsMatch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment