ci: make package optional for docs upload

This commit is contained in:
iCrawl 2023-05-01 16:02:05 +02:00
parent 0f3d870ce6
commit 71983cc5d1
No known key found for this signature in database
GPG key ID: 1AB888B16355FBB2
3 changed files with 2 additions and 7 deletions

View file

@ -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

View file

@ -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:

View file

@ -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 {