diff --git a/.circleci/config.yml b/.circleci/config.yml index 7237ac8093a..747961f543a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -877,11 +877,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