Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[JENKINS-40652] Minimal fix for trusted revision
- Loading branch information
|
@@ -984,6 +984,11 @@ private void checkout(GitSCM scm, Run<?,?> build, GitClient git, TaskListener li |
|
|
public SCMRevision getTrustedRevision(SCMRevision revision, TaskListener listener) |
|
|
throws IOException, InterruptedException { |
|
|
if (revision instanceof PullRequestSCMRevision) { |
|
|
PullRequestSCMHead head = (PullRequestSCMHead) revision.getHead(); |
|
|
if (repoOwner.equals(head.getSourceRepo()) && repository.equals(head.getSourceRepo())) { |
|
|
// origin PR |
|
|
return revision; |
|
|
} |
|
|
/* |
|
|
* Evaluates whether this pull request is coming from a trusted source. |
|
|
* Quickest is to check whether the author of the PR |
|
@@ -1050,7 +1055,6 @@ public SCMRevision getTrustedRevision(SCMRevision revision, TaskListener listene |
|
|
} |
|
|
} |
|
|
} |
|
|
PullRequestSCMHead head = (PullRequestSCMHead) revision.getHead(); |
|
|
if (!collaboratorNames.contains(head.getSourceOwner())) { |
|
|
PullRequestSCMRevision rev = (PullRequestSCMRevision) revision; |
|
|
listener.getLogger().format("Loading trusted files from base branch %s at %s rather than %s%n", |
|
|