Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2527cc2a07 | ||
|
|
b8359a9f76 | ||
|
|
90ca0c9dda |
+3
-12
@@ -100,20 +100,11 @@ bazel build --spawn_strategy=standalone //:run
|
|||||||
|
|
||||||
// 1. Determine target branch and fetch changes
|
// 1. Determine target branch and fetch changes
|
||||||
def targetBranch = env.CHANGE_TARGET ?: 'main'
|
def targetBranch = env.CHANGE_TARGET ?: 'main'
|
||||||
|
sh "git fetch origin ${targetBranch}"
|
||||||
|
|
||||||
sh """
|
// 2. Identify changed files relative to the target branch
|
||||||
git fetch origin \
|
|
||||||
+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}
|
|
||||||
"""
|
|
||||||
def mergeBase = sh(
|
|
||||||
script: "git merge-base HEAD origin/${targetBranch}",
|
|
||||||
returnStdout: true
|
|
||||||
).trim()
|
|
||||||
|
|
||||||
echo "Merge base: ${mergeBase}"
|
|
||||||
|
|
||||||
def changedFiles = sh(
|
def changedFiles = sh(
|
||||||
script: "git diff --name-only ${mergeBase} HEAD",
|
script: "git diff --name-only origin/${targetBranch}...HEAD",
|
||||||
returnStdout: true
|
returnStdout: true
|
||||||
).trim()
|
).trim()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user