Compare commits

..

2 Commits

Author SHA1 Message Date
Jen Basch 1d60a7c29a Fix spotless ratcheting on release branches (#1401) 2026-01-09 14:19:16 -08:00
Jen Basch a4879728fd Fix doc links from pkl:base to pkl:math (#1400) 2026-01-09 11:31:31 -08:00
2 changed files with 12 additions and 2 deletions
@@ -1,5 +1,5 @@
/*
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -142,9 +142,17 @@ private fun KotlinGradleExtension.configureFormatter() {
}
val originalRemoteName = System.getenv("PKL_ORIGINAL_REMOTE_NAME") ?: "origin"
// if we're running against a release branch (or a PR targeted at one), use that branch for
// ratcheting
// these env vars are set by GitHub actions:
// https://docs.github.com/en/actions/reference/workflows-and-actions/variables#default-environment-variables
val ratchetBranchName =
(System.getenv("GITHUB_BASE_REF") ?: System.getenv("GITHUB_REF_NAME"))?.let {
if (it.startsWith("release/")) it else null
} ?: "main"
spotless {
ratchetFrom = "$originalRemoteName/main"
ratchetFrom = "$originalRemoteName/$ratchetBranchName"
// When building root project, format buildSrc files too.
// We need this because buildSrc is not a subproject of the root project, so a top-level
+2
View File
@@ -20,7 +20,9 @@
@ModuleInfo { minPklVersion = "0.30.2" }
module pkl.base
// math import used for doc comments
import "pkl:jsonnet"
import "pkl:math"
import "pkl:pklbinary"
import "pkl:protobuf"
import "pkl:xml"