From: Patrick Donnelly Date: Mon, 12 May 2025 01:41:41 +0000 (-0400) Subject: script: ignore main branch when cleaning ci X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4ed4bdcc38355f42cca14f20794ab70010e9f125;p=ceph.git script: ignore main branch when cleaning ci 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 --- diff --git a/src/script/clean-ci b/src/script/clean-ci index 555cdc346b6e9..1f49a44f763a8 100755 --- a/src/script/clean-ci +++ b/src/script/clean-ci @@ -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")