Skip to content

Commit

Permalink
Merge pull request #205 from codacy/add-github-action-provider
Browse files Browse the repository at this point in the history
feature: Add support for GitHub Actions provider
  • Loading branch information
Francisco Duarte authored May 6, 2020
2 parents f3a6646 + 627513a commit 6d29565
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ object CommitUUIDProvider extends StrictLogging {
new CodefreshCIProvider,
new CodeshipCIProvider,
new DockerProvider,
new GitHubActionProvider,
new GitlabProvider,
new GreenhouseCIProvider,
new HerokuCIProvider,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.codacy.rules.commituuid.providers

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

class GitHubActionProvider extends CommitUUIDProvider {
val name: String = "GitHub Actions"

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

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

0 comments on commit 6d29565

Please sign in to comment.