Skip to content

Commit

Permalink
Merge pull request #468 from codacy/add-drone-ci-support
Browse files Browse the repository at this point in the history
Add Drone CI as new commitUuid provider
  • Loading branch information
DMarinhoCodacy authored Aug 2, 2023
2 parents 37f692c + 9de0220 commit 5f6caf9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ object CommitUUIDProvider extends LogSupport {
CodefreshCIProvider,
CodeshipCIProvider,
DockerProvider,
DroneCIProvider,
GitHubActionProvider,
GitlabProvider,
GreenhouseCIProvider,
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

/* Drone CI Provider */
object DroneCIProvider extends CommitUUIDProvider {
val name: String = "Drone CI"

override def validateEnvironment(environment: Map[String, String]): Boolean = {
environment.get("CI").contains("true") && environment.get("DRONE").contains("true")
}

override def getValidCommitUUID(environment: Map[String, String]): Either[String, CommitUUID] =
parseEnvironmentVariable(environment.get("DRONE_COMMIT") orElse environment.get("DRONE_COMMIT_SHA"))
}

0 comments on commit 5f6caf9

Please sign in to comment.