From 5f2095b76c9ee6f1df9c85efd61cf5389881acc4 Mon Sep 17 00:00:00 2001 From: Qjuh <76154676+Qjuh@users.noreply.github.com> Date: Sat, 9 Mar 2024 13:52:38 +0100 Subject: [PATCH] ci: use correct github tag in docs source links (#10163) * ci: use correct github tag in docs source links * fix: also apply on new tags --- .github/workflows/documentation.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 9d55fdb1a..7687894d7 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -66,6 +66,17 @@ jobs: pnpm run build cd .. + - name: Extract package and semver from tag + if: ${{ env.REF_TYPE == 'tag' }} + id: extract-tag + uses: ./packages/actions/src/formatTag + with: + tag: ${{ inputs.ref || github.ref_name }} + + - name: Apply tag to api-extractor config + if: ${{ env.REF_TYPE == 'tag' && !inputs.ref }} + run: sed -i 's!https://github.com/discordjs/discord.js/tree/main!https://github.com/discordjs/discord.js/tree/${{ steps.extract-tag.outputs.semver }}!' "packages/${{ steps.extract-tag.outputs.package}}/" + - name: Build docs run: pnpm run docs @@ -75,6 +86,7 @@ jobs: declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "formatters" "next" "proxy" "rest" "util" "voice" "ws") for PACKAGE in "${PACKAGES[@]}"; do 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 ../../main/packages/scripts/bin/generateSplitDocumentation cd ../.. @@ -87,13 +99,6 @@ jobs: token: ${{ secrets.DJS_DOCS }} path: 'out' - - name: Extract package and semver from tag - if: ${{ env.REF_TYPE == 'tag' }} - id: extract-tag - uses: ./packages/actions/src/formatTag - with: - tag: ${{ inputs.ref || github.ref_name }} - - name: Upload documentation to database if: ${{ env.REF_TYPE == 'tag' && (!inputs.ref || inputs.ref == 'main') }} env: