Skip to content

Commit

Permalink
Run 'dependency-submission' job in CI only for the base repository
Browse files Browse the repository at this point in the history
  • Loading branch information
danicheg committed Jul 22, 2024
1 parent 4059b10 commit adadc7a
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions ci/src/main/scala/org/typelevel/sbt/TypelevelCiPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ package org.typelevel.sbt

import org.typelevel.sbt.NoPublishGlobalPlugin.noPublishModulesIgnore
import org.typelevel.sbt.gha.GenerativePlugin
import org.typelevel.sbt.gha.GenerativePlugin.autoImport._
import org.typelevel.sbt.gha.GenerativePlugin.autoImport.*
import org.typelevel.sbt.gha.GitHubActionsPlugin
import org.typelevel.sbt.gha.WorkflowStep
import sbt._
import org.typelevel.sbt.kernel.GitHelper
import sbt.*

import scala.language.experimental.macros

Expand Down Expand Up @@ -140,7 +141,13 @@ object TypelevelCiPlugin extends AutoPlugin {
githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8")),
githubWorkflowAddedJobs ++= {
val dependencySubmission =
if (tlCiDependencyGraphJob.value)
if (tlCiDependencyGraphJob.value) {
val githubRepo = GitHelper.extractGitHubUserRepo.map(x => x._1 + '/' + x._2)
val jobCondition =
githubRepo.fold(
"github.event_name != 'pull_request'"
)(repo => s"github.repository == '$repo' && github.event_name != 'pull_request'")

List(
WorkflowJob(
"dependency-submission",
Expand All @@ -155,9 +162,9 @@ object TypelevelCiPlugin extends AutoPlugin {
Some(List("test", "scala-tool", "scala-doc-tool", "test-internal")),
None
),
cond = Some("github.event_name != 'pull_request'")
cond = Some(jobCondition)
))
else Nil
} else Nil

dependencySubmission
},
Expand Down

0 comments on commit adadc7a

Please sign in to comment.