From 71983cc5d1c5e79149ba1da93cc46c3397add349 Mon Sep 17 00:00:00 2001 From: iCrawl Date: Mon, 1 May 2023 16:02:05 +0200 Subject: [PATCH] ci: make package optional for docs upload --- .github/workflows/documentation.yml | 4 ---- packages/actions/src/uploadDocumentation/action.yml | 1 - packages/actions/src/uploadDocumentation/index.ts | 4 ++-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index d69feb7a3..63c8f696d 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -91,13 +91,9 @@ jobs: env: DATABASE_URL: ${{ secrets.DATABASE_URL }} uses: ./packages/actions/src/uploadDocumentation - with: - package: ${{ steps.extract-tag.outputs.package }} - name: Move docs to correct directory if: ${{ github.ref_type == 'branch' }} - env: - PACKAGE: ${{ steps.extract-tag.outputs.package }} run: | declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "next" "formatters" "proxy" "rest" "util" "voice" "ws") for PACKAGE in "${PACKAGES[@]}"; do diff --git a/packages/actions/src/uploadDocumentation/action.yml b/packages/actions/src/uploadDocumentation/action.yml index 60e0ef272..fbe58e23c 100644 --- a/packages/actions/src/uploadDocumentation/action.yml +++ b/packages/actions/src/uploadDocumentation/action.yml @@ -3,7 +3,6 @@ description: 'Uploads the docs.api.json file to a planetscale database' inputs: package: description: 'The package string' - required: true version: description: 'The semver string' runs: diff --git a/packages/actions/src/uploadDocumentation/index.ts b/packages/actions/src/uploadDocumentation/index.ts index 8cf82eb23..ff3475e61 100644 --- a/packages/actions/src/uploadDocumentation/index.ts +++ b/packages/actions/src/uploadDocumentation/index.ts @@ -9,7 +9,7 @@ if (!process.env.DATABASE_URL) { setFailed('DATABASE_URL is not set'); } -const pkg = getInput('package', { required: true }); +const pkg = getInput('package') || '*'; const version = getInput('version') || 'main'; const sql = connect({ @@ -17,7 +17,7 @@ const sql = connect({ url: process.env.DATABASE_URL!, }); -const globber = await create(`docs/${pkg}/docs/docs.api.json`); +const globber = await create(`packages/${pkg}/docs/docs.api.json`); for await (const file of globber.globGenerator()) { const data = await readFile(file, 'utf8'); try {