File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
2+ * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -142,9 +142,17 @@ private fun KotlinGradleExtension.configureFormatter() {
142142}
143143
144144val originalRemoteName = System .getenv(" PKL_ORIGINAL_REMOTE_NAME" ) ? : " origin"
145+ // if we're running against a release branch (or a PR targeted at one), use that branch for
146+ // ratcheting
147+ // these env vars are set by GitHub actions:
148+ // https://docs.github.com/en/actions/reference/workflows-and-actions/variables#default-environment-variables
149+ val ratchetBranchName =
150+ (System .getenv(" GITHUB_BASE_REF" ) ? : System .getenv(" GITHUB_REF_NAME" ))?.let {
151+ if (it.startsWith(" release/" )) it else null
152+ } ? : " main"
145153
146154spotless {
147- ratchetFrom = " $originalRemoteName /main "
155+ ratchetFrom = " $originalRemoteName /$ratchetBranchName "
148156
149157 // When building root project, format buildSrc files too.
150158 // We need this because buildSrc is not a subproject of the root project, so a top-level
You can’t perform that action at this time.
0 commit comments