From 8008994c509827b5577951ab0517929c9aa21912 Mon Sep 17 00:00:00 2001 From: Ramesh Padmanabhaiah <22363102+codeforester@users.noreply.github.com> Date: Thu, 20 Aug 2026 05:51:07 +0530 Subject: [PATCH] ci: make release tests post-GA safe --- .github/workflows/tests.yml | 2 ++ tests/release.bats | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ccc21fc..b9c5e64 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,6 +27,8 @@ jobs: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: persist-credentials: false + fetch-depth: 0 + fetch-tags: true - name: Install validation tools (macOS) if: runner.os == 'macOS' diff --git a/tests/release.bats b/tests/release.bats index 99f6e2f..e598dea 100644 --- a/tests/release.bats +++ b/tests/release.bats @@ -22,15 +22,18 @@ setup() { cat >"$RELEASE_GIT_STUB" <<'EOF' #!/usr/bin/env bash -if [[ "${BASE_BASH_RELEASE_TEST_LOCAL_TAG:-}" == present && "$*" == *"show-ref --verify --quiet refs/tags/"* ]]; then - exit 0 +if [[ "$*" == *"show-ref --verify --quiet refs/tags/"* ]]; then + if [[ "${BASE_BASH_RELEASE_TEST_LOCAL_TAG:-}" == present ]]; then + exit 0 + fi + exit 1 fi if [[ "$*" == *"ls-remote --tags origin refs/tags/"* ]]; then if [[ "${BASE_BASH_RELEASE_TEST_REMOTE_STATUS:-ok}" == error ]]; then exit 2 fi if [[ "${BASE_BASH_RELEASE_TEST_REMOTE_TAG:-}" == present ]]; then - printf 'deadbeef refs/tags/v2.0.0\n' + printf 'deadbeef refs/tags/%s\n' "${*##*refs/tags/}" fi exit 0 fi