Pier Angelo Vendrame pushed to branch mullvad-browser-128.7.0esr-14.5-1 at The 
Tor Project / Applications / Mullvad Browser


Commits:
40c8eec9 by Beatriz Rizental at 2025-02-03T15:36:14+01:00
fixup! Add CI for Base Browser

- - - - -


1 changed file:

- .gitlab/ci/mixins.yml


Changes:

=====================================
.gitlab/ci/mixins.yml
=====================================
@@ -4,7 +4,21 @@
   before_script:
     - git init
     - git remote add local "$LOCAL_REPO_PATH"
-    - git fetch --depth 500 local 
${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME}
+    - |
+      # Determine the reference of the target branch in the local repository 
copy.
+      #
+      # 1. List all references in the local repository
+      # 2. Filter the references to the target branch
+      # 3. Remove tags
+      # 4. Keep a single line, in case there are too many matches
+      # 5. Clean up the output
+      # 6. Remove everything before the last two slashes, because the output 
is like `refs/heads/...` or `refs/remotes/...`
+      TARGET_BRANCH=$(git ls-remote local | grep 
${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME} |  grep -v 
'refs/tags/' | awk '{print $2}' | tail -1 | sed 's|[^/]*/[^/]*/||')
+      if [ -z "$TARGET_BRANCH" ]; then
+          echo "Target branch $TARGET_BRANCH is not yet in local repository. 
Stopping the pipeline."
+          exit 1
+      fi
+    - git fetch --depth 500 local $TARGET_BRANCH
     - git remote add origin "$CI_REPOSITORY_URL"
     - |
       if [ -z "${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" ]; 
then
@@ -31,7 +45,11 @@
       if ([string]::IsNullOrEmpty($branchName)) {
           $branchName = $env:CI_MERGE_REQUEST_TARGET_BRANCH_NAME
       }
-      git fetch --depth 500 local $branchName
+      $TARGET_BRANCH = git ls-remote local | Select-String -Pattern 
$branchName | Select-String -Pattern -NotMatch 'refs/tags/' | Select-Object 
-Last 1 | ForEach-Object { $_.ToString().Split()[1] -replace '^[^/]*/[^/]*/', 
'' }
+      if ([string]::IsNullOrEmpty($TARGET_BRANCH)) {
+          Write-Output "Target branch $TARGET_BRANCH is not yet in local 
repository. Stopping the pipeline."
+          exit 1
+      }
     - git remote add origin $env:CI_REPOSITORY_URL
     - |
       $branchName = $env:CI_COMMIT_BRANCH



View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/40c8eec99a9d801bd78e60ba8d88ea97f301c5ee

-- 
View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/40c8eec99a9d801bd78e60ba8d88ea97f301c5ee
You're receiving this email because of your account on gitlab.torproject.org.


_______________________________________________
tbb-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]
  • [tbb-commits] [Git][tpo/app... Pier Angelo Vendrame (@pierov) via tbb-commits

Reply via email to