GitUtils { @Nullable public static String findSlug(Project project) { if (currentlyRunningOnGithubActions()) { return System.getenv("GITHUB_REPOSITORY"); } String travisSlug = findTravisSlug(project); if (travisSlug != null) { return travisSlug; } String remoteUrl = getRemoteUrl(project, "origin"); Matcher httpsMatcher = httpsUrlPattern.matcher(remoteUrl); if (httpsMatcher.matches()) { return httpsMatcher.group(1); } Matcher sshMatcher = sshUrlPattern.matcher(remoteUrl); if (sshMatcher.matches()) { return sshMatcher.group(1); } return null; }  static boolean currentlyRunningOnTravisCi(); static boolean currentlyRunningOnGithubActions(); @Nullable static String findSlug(Project project); @Nullable String findTravisSlug(Project project); String getRemoteUrl(Project project, String remote); File findWorkingDirectory(Project project); String getTag(Project project); @Nullable String findGithubUsername(Project project); @Nullable String findGithubToken(Project project);  }
@Test void findSlug() { assertThat(GitUtils.findSlug(project)) .isEqualTo("freefair/gradle-plugins"); }