]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
script: ignore main branch when cleaning ci 63221/head
authorPatrick Donnelly <pdonnell@ibm.com>
Mon, 12 May 2025 01:41:41 +0000 (21:41 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Mon, 12 May 2025 01:42:13 +0000 (21:42 -0400)
Addresses failures like:

     Deleting refs: refs/heads/main refs/heads/wip-athakkar-testing-2025-02-11-1344 refs/heads/wip-choffman-fscrypt-021225 refs/heads/wip-dang-68336 refs/heads/wip-leonidc-7_1_hotfix refs/heads/wip-nia-testing-2025-02-12-0101 refs/heads/wip-nitzan-gil-perf-count-and-contention-detect refs/heads/wip-rf-perf-sections refs/heads/wip-sseshasa-test-stuck-backfill-squid-feb11-2024 refs/heads/wip-sseshasa-test-stuck-backfill-squid-feb12-2024 refs/heads/wip-yuri8-testing-2025-02-10-2350
    To https://github.com/ceph/ceph-ci
     - [deleted]           wip-athakkar-testing-2025-02-11-1344
     - [deleted]           wip-choffman-fscrypt-021225
     - [deleted]           wip-dang-68336
     - [deleted]           wip-leonidc-7_1_hotfix
     - [deleted]           wip-nia-testing-2025-02-12-0101
     - [deleted]           wip-nitzan-gil-perf-count-and-contention-detect
     - [deleted]           wip-rf-perf-sections
     - [deleted]           wip-sseshasa-test-stuck-backfill-squid-feb11-2024
     - [deleted]           wip-sseshasa-test-stuck-backfill-squid-feb12-2024
     - [deleted]           wip-yuri8-testing-2025-02-10-2350
     ! [remote rejected]   main (refusing to delete the current branch: refs/heads/main)
    error: failed to push some refs to 'https://github.com/ceph/ceph-ci'
    Error: Process completed with exit code 1.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/script/clean-ci

index 555cdc346b6e9083e0aad56008d34b1449c997d9..1f49a44f763a8e33fa97b5f233b6767f2c241c87 100755 (executable)
@@ -47,6 +47,11 @@ function iterate_ci {
         commit=$(cut -f1 <<<"$commit_ref")
         ref=$(cut -f2 <<<"$commit_ref")
 
+        if [[ "$ref" == 'refs/heads/main' ]]; then
+          eprintf 'Ignoring main branch'
+          continue
+        fi
+
         eprintf 'Examining %s (commit %s)' "$ref" "$commit"
 
         commit_date=$(git log -1 --format="%ct" "$commit")