-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from jeremiemv/feat/add-heroku-ci-support
feature: Add Heroku CI support
- Loading branch information
Showing
3 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/scala/com/codacy/rules/commituuid/providers/HerokuCIProvider.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) | ||
} |