From fb64187faa37911e563355f139057105de1a975f Mon Sep 17 00:00:00 2001 From: logicmoo Date: Mon, 25 Nov 2024 03:33:28 -0800 Subject: [PATCH] ensure just-results exists now --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e31e19ec1e..ecc58c652ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,20 +32,20 @@ jobs: - name: Ensure just-results branch exists run: | - git clone https://github.com/${{ github.repository }} previous-results - cd previous-results - git fetch origin - if git show-ref --verify --quiet refs/remotes/origin/just-results; then - echo "just-results branch exists." - git checkout just-results - else - echo "just-results branch does not exist. Creating it." - git checkout --orphan just-results - git rm -rf . + git ls-remote --heads ${{ env.REPO_URL }} just-results + if [ $? -ne 0 ]; then + echo "just-results branch does not exist. Creating it." + git init previous-results + cd previous-results + git checkout -b just-results touch current_test_results.txt git add current_test_results.txt git commit -m "Initialize just-results branch" + git remote add origin ${{ env.REPO_URL }} git push origin just-results + else + echo "just-results branch exists. Cloning it." + git clone --single-branch --branch just-results --depth 1 ${{ env.REPO_URL }} previous-results fi - name: Copy Previous Test Results