You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: git-changelist-maven-extension/src/main/java/io/jenkins/tools/incrementals/git_changelist_maven_extension/Main.java
+30
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,36 @@ public void afterSessionStart(MavenSession session) throws MavenExecutionExcepti
137
137
} else {
138
138
log.info("Declining to override the `changelist` or `scmTag` properties");
139
139
}
140
+
if (!props.contains("gitHubRepo")) {
141
+
StringgitHubRepo;
142
+
StringchangeFork = System.getenv("CHANGE_FORK");
143
+
if (changeFork == null) {
144
+
log.info("No information available to set -DgitHubRepo");
145
+
gitHubRepo = null;
146
+
} elseif (changeFork.contains("/")) {
147
+
gitHubRepo = changeFork;
148
+
} else {
149
+
StringjobName = System.getenv("JOB_NAME");
150
+
if (jobName == null) {
151
+
log.info("CHANGE_FORK set but incomplete with JOB_NAME");
152
+
gitHubRepo = null;
153
+
} else {
154
+
String[] pieces = jobName.split("/");
155
+
if (pieces.length >= 2) { // e.g. Plugins/build-token-root-plugin/PR-21
if (!developerConnectionRGHR.gitHubRepo.equals(connectionRGHR.gitHubRepo) || !urlRGHR.gitHubRepo.equals(connectionRGHR.gitHubRepo)) {
135
+
thrownewMojoFailureException("Mismatch among gitHubRepo parts of <scm>: " + connectionRGHR.gitHubRepo + " vs. " + developerConnectionRGHR.gitHubRepo + " vs. " + urlRGHR.gitHubRepo);
136
+
}
125
137
Stringminimum_parent;
126
138
if (parent.getDependencyConflictId().equals(JENKINS_POM)) {
127
139
minimum_parent = MINIMUM_JENKINS_PARENT;
@@ -131,9 +143,30 @@ public class IncrementalifyMojo extends AbstractVersionsUpdaterMojo {
131
143
if (newComparableVersion(parent.getVersion()).compareTo(newComparableVersion(minimum_parent)) < 0) {
0 commit comments