Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,35 +96,45 @@
_ => ""
)

s"""|$updatesText
|
|## Usage
|✅ **Please merge!**
|
|I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
|
|${skipVersionMessage}If you have any feedback, just mention me in the comments below.
|
|Configure Scala Steward for your repository with a [`${RepoConfigAlg.repoConfigBasename}`](${org.scalasteward.core.BuildInfo.gitHubUrl}/blob/${org.scalasteward.core.BuildInfo.gitHeadCommit}/docs/repo-specific-configuration.md) file.
|
|_Have a fantastic day writing Scala!_
|
|${details.map(_.toHtml).mkString("\n")}
|
|<sup>
|${labels.mkString("labels: ", ", ", "")}
|</sup>
|
|<!-- scala-steward = ${metadataJson(update, labels)} -->""".stripMargin.trim
}
val plainBody =
s"""|$updatesText
|
|## Usage
|✅ **Please merge!**
|
|I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
|
|${skipVersionMessage}If you have any feedback, just mention me in the comments below.
|
|Configure Scala Steward for your repository with a [`${RepoConfigAlg.repoConfigBasename}`](${org.scalasteward.core.BuildInfo.gitHubUrl}/blob/${org.scalasteward.core.BuildInfo.gitHeadCommit}/docs/repo-specific-configuration.md) file.
|
|_Have a fantastic day writing Scala!_
|
|${details.map(_.toHtml).mkString("\n")}
|
|<sup>
|${labels.mkString("labels: ", ", ", "")}
|</sup>
|""".stripMargin.trim

def metadataJson(update: Update, labels: List[String]): String =
Json
.obj(
"Update" -> update.asJson,
"Labels" -> Json.fromValues(labels.map(_.asJson))
)
.toString
val metadataJson =
Json
.obj(
"Update" -> update.asJson,
"Labels" -> Json.fromValues(labels.map(_.asJson))
)
.toString

val bodyWithMetadata =
s"""$plainBody
|
|<!-- scala-steward = $metadataJson -->""".stripMargin

// Github limits PR descriptions to 65536 unicode characters
if (bodyWithMetadata.length < 65536)
bodyWithMetadata
else plainBody

Check warning on line 136 in modules/core/src/main/scala/org/scalasteward/core/forge/data/NewPullRequestData.scala

View check run for this annotation

Codecov / codecov/patch

modules/core/src/main/scala/org/scalasteward/core/forge/data/NewPullRequestData.scala#L136

Added line #L136 was not covered by tests
}

def renderUpdateInfoUrls(updateInfoUrls: List[UpdateInfoUrl]): Option[String] =
Option.when(updateInfoUrls.nonEmpty) {
Expand Down
Loading