Skip to content

Commit

Permalink
Added: more types for runGitHubRelease method to make it safer
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-lee committed Oct 15, 2019
1 parent a250d3a commit 5b709d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/main/scala/kevinlee/github/data/github.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ object Repo {
}

final case class Changelog(changelog: String) extends AnyVal
final case class ChangelogLocation(changeLogLocation: String) extends AnyVal

final case class GitHubRelease(
tagName: TagName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ object DevOopsGitReleasePlugin extends AutoPlugin {
tagName
, assets
, baseDirectory.value
, changelogLocation.value
, gitTagPushRepo.value
, ChangelogLocation(changelogLocation.value)
, Repository(gitTagPushRepo.value)
, oauth
)
)
Expand Down Expand Up @@ -263,8 +263,8 @@ object DevOopsGitReleasePlugin extends AutoPlugin {
tagName
, assets
, baseDirectory.value
, changelogLocation.value
, gitTagPushRepo.value
, ChangelogLocation(changelogLocation.value)
, Repository(gitTagPushRepo.value)
, oauth
)
)
Expand All @@ -284,17 +284,17 @@ object DevOopsGitReleasePlugin extends AutoPlugin {
tagName: TagName
, assets: Vector[File]
, baseDir: File
, changelogLocation: String
, gitTagPushRepo: String
, changelogLocation: ChangelogLocation
, gitTagPushRepo: Repository
, oAuthToken: OAuthToken
): GitHubTask.GitHubTaskResult[Unit] =
for {
changelog <- SbtTask.eitherTWithWriter(
getChangelog(new File(baseDir, changelogLocation), tagName))(
getChangelog(new File(baseDir, changelogLocation.changeLogLocation), tagName))(
_ => List("Get changelog")
)
url <- GitHubTask.fromGitTask(
Git.getRemoteUrl(Repository(gitTagPushRepo), baseDir)
Git.getRemoteUrl(gitTagPushRepo, baseDir)
)
repo <- SbtTask.eitherTWithWriter(
getRepoFromUrl(url))(
Expand Down

0 comments on commit 5b709d7

Please sign in to comment.