From 230e746b3165e320754ff947f4e02a3139668b0e Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Wed, 8 Oct 2025 18:05:34 +0100 Subject: [PATCH] ci(documentation): Skip unknown packages on old refs (#11154) ci(documentation): handle old refs for unknown packages --- .github/workflows/documentation.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 8b7f28a4a..ee7860806 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -89,6 +89,11 @@ jobs: run: | declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "formatters" "next" "proxy" "rest" "structures" "util" "voice" "ws") for PACKAGE in "${PACKAGES[@]}"; do + if [ ! -d "packages/${PACKAGE}" ]; then + echo "::notice::${PACKAGE} does not exist on this ref. Skipping..." + continue + fi + cd "packages/${PACKAGE}" sed -i 's!https://github.com/discordjs/discord.js/tree/main!https://github.com/discordjs/discord.js/tree/${{ inputs.ref }}!' api-extractor.json ../../main/packages/api-extractor/bin/api-extractor run --local --minify @@ -222,6 +227,11 @@ jobs: run: | declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "formatters" "next" "proxy" "rest" "structures" "util" "voice" "ws") for PACKAGE in "${PACKAGES[@]}"; do + if [ ! -d "packages/${PACKAGE}" ]; then + echo "::notice::${PACKAGE} does not exist on this ref. Skipping..." + continue + fi + if [[ "${PACKAGE}" == "discord.js" ]]; then mkdir -p "out/${PACKAGE}" mv "packages/${PACKAGE}/docs/docs.json" "out/${PACKAGE}/${GITHUB_REF_NAME}.json"