From 6e8aaa29b0074c0c76c9606113e5cbdebfdd7c8a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 29 Feb 2024 09:27:01 +0100 Subject: fix(openapi): Make sure typescript models are updated Signed-off-by: Joas Schilling --- .github/workflows/openapi.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to '.github') 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() -- cgit v1.2.3