Skip to content

Commit 246a369

Browse files
committed
Failhard in CI if the remote URL cannot be found
1 parent 6c7ccbc commit 246a369

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/groovy/net/minecraftforge/gradleutils/PomUtils.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ final class PomUtils {
117117
org.url.set 'https://minecraftforge.net'
118118
}
119119

120+
var inCI = GradleUtils.hasEnvVar('GITHUB_ACTIONS', this.providers).get().booleanValue()
121+
120122
var remoteUrl = stripProtocol(this.gitversion.version.info.url)
121123
var url = remoteUrl
122124
if (organization && repo) {
@@ -133,6 +135,9 @@ final class PomUtils {
133135
this.logger.warn """
134136
WARNING: The GitHub URL for this repo could not be automatically determined by GitVersion.
135137
This is likely due to the repository not having any remotes, or not having one set."""
138+
if (inCI)
139+
throw new IllegalStateException('GitHub URL could not be determined, which is required in CI')
140+
136141
return
137142
}
138143

0 commit comments

Comments
 (0)