From 968d6ab23521338988f31ffbb5805ad07b4a0c6d Mon Sep 17 00:00:00 2001 From: danicheg Date: Tue, 23 Jul 2024 11:28:23 +0400 Subject: [PATCH] Adjust the 'dependency-submission' job condition --- .../main/scala/org/typelevel/sbt/TypelevelCiPlugin.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/src/main/scala/org/typelevel/sbt/TypelevelCiPlugin.scala b/ci/src/main/scala/org/typelevel/sbt/TypelevelCiPlugin.scala index 70fa37bd..9a702623 100644 --- a/ci/src/main/scala/org/typelevel/sbt/TypelevelCiPlugin.scala +++ b/ci/src/main/scala/org/typelevel/sbt/TypelevelCiPlugin.scala @@ -142,11 +142,11 @@ object TypelevelCiPlugin extends AutoPlugin { githubWorkflowAddedJobs ++= { val dependencySubmission = if (tlCiDependencyGraphJob.value) { - val githubRepo = GitHelper.extractGitHubUserRepo.map(x => x._1 + '/' + x._2) + val ghRepo = GitHelper.extractGitHubUserRepo.map(x => x._1 + '/' + x._2) + val ghEventCond = "github.event_name != 'pull_request'" + val ghRepoCond = (repo: String) => s"github.repository == '$repo'" val jobCondition = - githubRepo.fold( - "github.event_name != 'pull_request'" - )(repo => s"github.repository == '$repo' && github.event_name != 'pull_request'") + ghRepo.fold(ghEventCond)(repo => s"${ghRepoCond(repo)} && $ghEventCond") List( WorkflowJob(