]> git.lizzy.rs Git - rust.git/blobdiff - src/ci/shared.sh
Rollup merge of #84462 - jsha:focus-search-results2, r=GuillaumeGomez
[rust.git] / src / ci / shared.sh
index 3c196c9478cf8adfdb91aac614434078431a5b44..332a949a4dc51bda7202d33aa63337d8902c4212 100644 (file)
@@ -73,6 +73,18 @@ function isCiBranch {
     fi
 }
 
+function ciBaseBranch {
+    if isAzurePipelines; then
+        echo "unsupported on Azure Pipelines"
+        exit 1
+    elif isGitHubActions; then
+        echo "${GITHUB_BASE_REF#refs/heads/}"
+    else
+        echo "ciBaseBranch only works inside CI!"
+        exit 1
+    fi
+}
+
 function ciCommit {
     if isAzurePipelines; then
         echo "${BUILD_SOURCEVERSION}"