diff options
author | Joas Schilling <coding@schilljs.com> | 2024-02-29 09:27:01 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-02-29 09:32:12 +0100 |
commit | 6e8aaa29b0074c0c76c9606113e5cbdebfdd7c8a (patch) | |
tree | 34b03126645621df7f153bdc0ef8f73a1f90294c | |
parent | c07fb6fa424d74f6fe5283ce9bce3d7664508365 (diff) |
fix(openapi): Make sure typescript models are updated
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | .github/workflows/openapi.yml | 26 | ||||
-rw-r--r-- | composer.json | 2 | ||||
-rw-r--r-- | src/types/openapi/openapi-full.ts | 1 | ||||
-rw-r--r-- | src/types/openapi/openapi.ts | 1 |
4 files changed, 27 insertions, 3 deletions
diff --git a/.github/workflows/openapi.yml b/.github/workflows/openapi.yml index 12735ece0..ad83a127d 100644 --- a/.github/workflows/openapi.yml +++ b/.github/workflows/openapi.yml @@ -29,15 +29,37 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2 + id: versions + with: + fallbackNode: '^20' + fallbackNpm: '^10' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v3 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" + + - name: Install dependencies & build + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: | + npm ci + - name: Set up dependencies run: composer i - name: Regenerate OpenAPI run: composer run openapi - - name: Check openapi.json changes + - name: Check openapi*.json and typescript changes run: | - bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please run \"composer run openapi\" and commit the openapi.json, see the section \"Show changes on failure\" for details' && exit 1)" + bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please run \"composer run openapi\" and commit the openapi*.json files and src/types/openapi/openapi*.ts, see the section \"Show changes on failure\" for details' && exit 1)" - name: Show changes on failure if: failure() diff --git a/composer.json b/composer.json index 5ebe0ae75..edf167834 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "cs:check": "php-cs-fixer fix --dry-run --diff", "cs:fix": "php-cs-fixer fix", "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './lib/Vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -print0 | xargs -0 -n1 php -l", - "openapi": "generate-spec --verbose", + "openapi": "generate-spec --verbose && (npm run typescript:generate || echo 'Please manually regenerate the typescript OpenAPI models')", "psalm": "psalm --threads=1", "psalm:dev": "psalm --no-cache --threads=$(nproc)", "psalm:update-baseline": "psalm --threads=1 --update-baseline --set-baseline=tests/psalm-baseline.xml", diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index 7681d7582..cd0030fe1 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -588,6 +588,7 @@ export type components = { id: string; label: string; source: string; + mentionId: string; status: string | null; /** Format: int64 */ statusClearAt: number | null; diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index 2a6f05d09..a5ccf8acb 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -447,6 +447,7 @@ export type components = { id: string; label: string; source: string; + mentionId: string; status: string | null; /** Format: int64 */ statusClearAt: number | null; |