diff --git a/sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactPlugin.scala b/sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactPlugin.scala index 77bf616..cdf8092 100644 --- a/sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactPlugin.scala +++ b/sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactPlugin.scala @@ -25,8 +25,11 @@ object CodeArtifactPlugin extends AutoPlugin { codeArtifactPublish := dynamicallyPublish.value, codeArtifactRepo := CodeArtifactRepo.fromUrl(codeArtifactUrl.value), codeArtifactToken := sys.env + .get("CODEARTIFACT_AUTH_TOKEN") + .orElse( + Credentials.loadCredentials(Path.userHome / ".sbt" / "credentials").toOption.map(_.passwd) + ) .getOrElse( - "CODEARTIFACT_AUTH_TOKEN", CodeArtifact.getAuthToken(codeArtifactRepo.value) ), codeArtifactConnectTimeout := CodeArtifact.Defaults.CONNECT_TIMEOUT,