mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
ci: make package optional for docs upload
This commit is contained in:
4
.github/workflows/documentation.yml
vendored
4
.github/workflows/documentation.yml
vendored
@@ -91,13 +91,9 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
||||||
uses: ./packages/actions/src/uploadDocumentation
|
uses: ./packages/actions/src/uploadDocumentation
|
||||||
with:
|
|
||||||
package: ${{ steps.extract-tag.outputs.package }}
|
|
||||||
|
|
||||||
- name: Move docs to correct directory
|
- name: Move docs to correct directory
|
||||||
if: ${{ github.ref_type == 'branch' }}
|
if: ${{ github.ref_type == 'branch' }}
|
||||||
env:
|
|
||||||
PACKAGE: ${{ steps.extract-tag.outputs.package }}
|
|
||||||
run: |
|
run: |
|
||||||
declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "next" "formatters" "proxy" "rest" "util" "voice" "ws")
|
declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "next" "formatters" "proxy" "rest" "util" "voice" "ws")
|
||||||
for PACKAGE in "${PACKAGES[@]}"; do
|
for PACKAGE in "${PACKAGES[@]}"; do
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ description: 'Uploads the docs.api.json file to a planetscale database'
|
|||||||
inputs:
|
inputs:
|
||||||
package:
|
package:
|
||||||
description: 'The package string'
|
description: 'The package string'
|
||||||
required: true
|
|
||||||
version:
|
version:
|
||||||
description: 'The semver string'
|
description: 'The semver string'
|
||||||
runs:
|
runs:
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ if (!process.env.DATABASE_URL) {
|
|||||||
setFailed('DATABASE_URL is not set');
|
setFailed('DATABASE_URL is not set');
|
||||||
}
|
}
|
||||||
|
|
||||||
const pkg = getInput('package', { required: true });
|
const pkg = getInput('package') || '*';
|
||||||
const version = getInput('version') || 'main';
|
const version = getInput('version') || 'main';
|
||||||
|
|
||||||
const sql = connect({
|
const sql = connect({
|
||||||
@@ -17,7 +17,7 @@ const sql = connect({
|
|||||||
url: process.env.DATABASE_URL!,
|
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()) {
|
for await (const file of globber.globGenerator()) {
|
||||||
const data = await readFile(file, 'utf8');
|
const data = await readFile(file, 'utf8');
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user