From 2e0776a0abb0b3186360d6052b48f7769e110495 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Thu, 4 Jan 2024 12:37:32 -0300 Subject: [PATCH] fix(docs): Fix docs build during releases (#3815) Fixes the issue introduced in #3762, which caused the docs build step to always attempt to fetch the last released version. Due to how release-plase works, the last released version during a release is the version being released, which is not available as a tag to be fetched. To avoid this issue, we first check if the tag to be checked out is available, and if not, just load the code snippets from master. --- .circleci/config.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7581421ad38..b049069c8c0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -892,11 +892,14 @@ jobs: - run: name: "Require released code" command: | - echo Requiring released code snippets - echo "INCLUDE_RELEASED_CODE=1" >> docs/.env LAST_TAG="aztec-packages-v$(jq -r '.["."]' .release-please-manifest.json)" - echo Fetching latest released tag $LAST_TAG - git fetch origin --refetch --no-filter refs/tags/$LAST_TAG:refs/tags/$LAST_TAG + if git ls-remote --tags origin | grep "$LAST_TAG" > /dev/null; then + echo "Using code released from $LAST_TAG" + echo "INCLUDE_RELEASED_CODE=1" >> docs/.env + git fetch origin --refetch --no-filter refs/tags/$LAST_TAG:refs/tags/$LAST_TAG + else + echo "Skipping as $LAST_TAG is not yet published" + fi - run: name: "Build docs" command: build docs