mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 23:24:42 +12:00
ci: make package optional for docs upload
This commit is contained in:
parent
0f3d870ce6
commit
71983cc5d1
3 changed files with 2 additions and 7 deletions
4
.github/workflows/documentation.yml
vendored
4
.github/workflows/documentation.yml
vendored
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue