diff --git a/docs/downloads/bitbucket-pipelines.yml b/docs/downloads/bitbucket-pipelines.yml index 0c3c256e7..ff3295905 100644 --- a/docs/downloads/bitbucket-pipelines.yml +++ b/docs/downloads/bitbucket-pipelines.yml @@ -40,7 +40,13 @@ pipelines: script: - git clone --shallow-since="6 months ago" --no-tags https://x-token-auth:$oauth_token@bitbucket.org/$full_repo.git gitstream/repo - git clone --depth=1 --no-tags https://x-token-auth:$oauth_token@bitbucket.org/$BITBUCKET_WORKSPACE/$BITBUCKET_REPO_SLUG.git gitstream/cm - - cd gitstream/repo && git fetch origin $head_ref:$head_ref && git checkout $head_ref + - | + set -e + cd gitstream/repo + git checkout --detach + # Fetch all branches so any base branch can be diffed; keep --shallow-since or this pulls full history. + git fetch --no-tags --force --shallow-since="6 months ago" origin '+refs/heads/*:refs/heads/*' + git checkout "$head_ref" - docker pull gitstream/rules-engine:latest - | docker run -v $BITBUCKET_CLONE_DIR/gitstream:/code \ diff --git a/docs/downloads/gitlab-ci.yml b/docs/downloads/gitlab-ci.yml index f4a952d0b..7169b7894 100644 --- a/docs/downloads/gitlab-ci.yml +++ b/docs/downloads/gitlab-ci.yml @@ -27,7 +27,13 @@ gitstream-job: script: - git clone --shallow-since="6 months ago" --no-tags https://gitlab-ci-token:${CI_JOB_TOKEN}${repoUrl} gitstream/repo - git clone --depth=1 --no-tags https://gitlab-ci-token:${CI_JOB_TOKEN}${cmUrl} gitstream/cm - - cd gitstream/repo && git fetch origin $head_ref:$head_ref && git checkout $head_ref + - | + set -e + cd gitstream/repo + git checkout --detach + # Fetch all branches so any base branch can be diffed; keep --shallow-since or this pulls full history. + git fetch --no-tags --force --shallow-since="6 months ago" origin '+refs/heads/*:refs/heads/*' + git checkout "$head_ref" - docker pull gitstream/rules-engine:latest - | docker run -v $CI_PROJECT_DIR/gitstream:/code \ diff --git a/docs/downloads/gitlab-k8s-ci.yml b/docs/downloads/gitlab-k8s-ci.yml index c202a9c15..3feab3e58 100644 --- a/docs/downloads/gitlab-k8s-ci.yml +++ b/docs/downloads/gitlab-k8s-ci.yml @@ -26,7 +26,13 @@ gitstream-job: script: - git clone --shallow-since="6 months ago" --no-tags https://gitlab-ci-token:${CI_JOB_TOKEN}${repoUrl} gitstream/repo - git clone --depth=1 --no-tags https://gitlab-ci-token:${CI_JOB_TOKEN}${cmUrl} gitstream/cm - - cd gitstream/repo && git fetch origin $head_ref:$head_ref && git checkout $head_ref + - | + set -e + cd gitstream/repo + git checkout --detach + # Fetch all branches so any base branch can be diffed; keep --shallow-since or this pulls full history. + git fetch --no-tags --force --shallow-since="6 months ago" origin '+refs/heads/*:refs/heads/*' + git checkout "$head_ref" - docker pull gitstream/rules-engine:latest - | docker run -v $CI_PROJECT_DIR/gitstream:/code \ diff --git a/docs/downloads/gitlab-shell-ci.yml b/docs/downloads/gitlab-shell-ci.yml index 0f8eb279e..7827514a2 100644 --- a/docs/downloads/gitlab-shell-ci.yml +++ b/docs/downloads/gitlab-shell-ci.yml @@ -20,7 +20,13 @@ gitstream-job: script: - git clone --shallow-since="6 months ago" --no-tags https://gitlab-ci-token:${CI_JOB_TOKEN}${repoUrl} gitstream/repo - git clone --depth=1 --no-tags https://gitlab-ci-token:${CI_JOB_TOKEN}${cmUrl} gitstream/cm - - cd gitstream/repo && git fetch origin $head_ref:$head_ref && git checkout $head_ref + - | + set -e + cd gitstream/repo + git checkout --detach + # Fetch all branches so any base branch can be diffed; keep --shallow-since or this pulls full history. + git fetch --no-tags --force --shallow-since="6 months ago" origin '+refs/heads/*:refs/heads/*' + git checkout "$head_ref" - docker pull gitstream/rules-engine:latest - | docker run -v $CI_PROJECT_DIR/gitstream:/code \