summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-02-29 09:27:01 +0100
committerJoas Schilling <coding@schilljs.com>2024-02-29 09:32:12 +0100
commit6e8aaa29b0074c0c76c9606113e5cbdebfdd7c8a (patch)
tree34b03126645621df7f153bdc0ef8f73a1f90294c /.github
parentc07fb6fa424d74f6fe5283ce9bce3d7664508365 (diff)
fix(openapi): Make sure typescript models are updated
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/openapi.yml26
1 files changed, 24 insertions, 2 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()