Skip to content

Commit

Permalink
Merge pull request #199 from jeremiemv/feat/add-heroku-ci-support
Browse files Browse the repository at this point in the history
feature: Add Heroku CI support
  • Loading branch information
lolgab authored Apr 21, 2020
2 parents 67247e0 + fa22fba commit 1e40e52
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/commit_detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Codacy automatically detects a commit SHA hash from several sources in the follo
- Docker
- Gitlab
- Greenhouse CI
- Heroku CI
- Jenkins
- Magnum CI
- Semaphore CI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ object CommitUUIDProvider extends StrictLogging {
new DockerProvider,
new GitlabProvider,
new GreenhouseCIProvider,
new HerokuCIProvider,
new JenkinsProvider,
new MagnumCIProvider,
new SemaphoreCIProvider,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.codacy.rules.commituuid.providers

import com.codacy.model.configuration.CommitUUID
import com.codacy.rules.commituuid.CommitUUIDProvider

/** Heroku CI provider */
class HerokuCIProvider extends CommitUUIDProvider {
val name: String = "Heroku CI"

override def validate(a: Map[String, String]): Boolean = {
a.get("CI").contains("true") && a.get("HEROKU_TEST_RUN_ID").isDefined
}

override def getUUID(a: Map[String, String]): Either[String, CommitUUID] =
withErrorMessage(a.get("HEROKU_TEST_RUN_COMMIT_VERSION"))
}

0 comments on commit 1e40e52

Please sign in to comment.