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
If cloning a repo on GitHub with HTTPS the remote URL is formatted like https://github.com/olafurpg/sbt-ci-release, which is not picked up by the automatic scmInfo detection in
case unauthenticated(domain, repo) => buildScmInfo(domain,repo)
case ssh(domain, repo) => buildScmInfo(domain,repo)
case headlessSSH(domain, repo) => buildScmInfo(domain,repo)
case _ =>None
}
}
A workaround is to add the following to buildSettings:
+ scmInfo ~= {+ case Some(info) => Some(info)+ case None =>+ import scala.sys.process._+ val identifier = """([^\/]+)"""+ val GitHubHttps = s"https://github.com/$identifier/$identifier".r+ try {+ val remote = List("git", "ls-remote", "--get-url", "origin").!!.trim()+ remote match {+ case GitHubHttps(user, repo) =>+ Some(+ ScmInfo(+ url(s"https://github.com/$user/$repo"),+ s"scm:git:https://github.com/$user/$repo.git",+ Some(s"scm:git:[email protected]:$user/$repo.git")+ )+ )+ case _ =>+ None+ }+ } catch {+ case NonFatal(_) => None+ }+ }
This issue was discovered while publishing a Sonatype release via GitHub Actions with the following error message
[error] Failed to close the repository
[error] Activity close started:2019-09-22T22:33:25.400Z, stopped:2019-09-22T22:33:33.729Z
[error] Failed: pom-staging, failureMessage:Invalid POM: /com/geirsson/sbt-ci-release_2.12_1.0/1.4.27/sbt-ci-release-1.4.27.pom: SCM URL missing
[error] java.lang.Exception: Failed to close the repository
[error] Use 'last' for the full log.
It appears that GitHub Actions clone the repository with the HTTPS remote instead of SSH remote.
The text was updated successfully, but these errors were encountered:
If cloning a repo on GitHub with HTTPS the remote URL is formatted like
https://github.com/olafurpg/sbt-ci-release
, which is not picked up by the automaticscmInfo
detection insbt-git/src/main/scala/com/typesafe/sbt/SbtGit.scala
Lines 124 to 146 in 74e03af
A workaround is to add the following to
buildSettings
:This issue was discovered while publishing a Sonatype release via GitHub Actions with the following error message
It appears that GitHub Actions clone the repository with the HTTPS remote instead of SSH remote.
The text was updated successfully, but these errors were encountered: