Release: merge development into beta #279
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow is provided via the organization template repository | |
| # | |
| # https://github.com/nextcloud/.github | |
| # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization | |
| # | |
| # SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | |
| # SPDX-FileCopyrightText: 2024 Arthur Schiwon <blizzz@arthur-schiwon.de> | |
| # SPDX-License-Identifier: MIT | |
| name: OpenAPI | |
| # This job had NEVER ONCE PASSED, for a reason that had nothing to do with this | |
| # repository's code: | |
| # | |
| # PHP Fatal error: license: Unable to convert EUPL-1.2 to SPDX identifier | |
| # | |
| # nextcloud/openapi-extractor maps licences through a hardcoded match() in | |
| # src/Helpers.php that accepts agpl / mit / mpl / apache / gpl3 and five SPDX | |
| # spellings, and calls Logger::panic() — a fatal, not a warning — on anything | |
| # else. EUPL-1.2 is a valid SPDX identifier and is what every Conduction app | |
| # ships under, so the tool could not run against any of them. Upstream `main` | |
| # still had the same list on 2026-08-18. | |
| # | |
| # We do not get to wait on an upstream fix, and we do not get to disable a | |
| # check to hide it. So the tool is PATCHED at install time — see | |
| # vendor-bin/openapi-extractor/patches/ and the composer-patches wiring beside | |
| # it. The patch is pinned to the exact version this repo already pinned | |
| # (v1.8.7); if that pin moves and the patch stops applying, composer fails | |
| # LOUDLY rather than silently reverting to the broken behaviour. | |
| # | |
| # Two dishonest routes were rejected on the way: mislabelling the licence to | |
| # suit the tool, and marking the step continue-on-error so a broken job | |
| # reports green. The second is worse than the red. | |
| # | |
| # With the fatal gone the extractor reaches this app's controllers for the | |
| # first time and reports real findings about them. Those are ours, and the | |
| # trigger is back on so they stay visible. | |
| on: pull_request | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: openapi-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| openapi: | |
| runs-on: ubuntu-latest | |
| # Observed fleet-wide: max 1.0 min (n=5). Deliberately loose. | |
| timeout-minutes: 20 | |
| if: ${{ github.repository_owner != 'nextcloud-gmbh' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Get php version | |
| id: php_versions | |
| uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2 | |
| - name: Set up php | |
| uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2.36.0 | |
| with: | |
| php-version: ${{ steps.php_versions.outputs.php-available }} | |
| extensions: xml | |
| coverage: none | |
| ini-file: development | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check Typescript OpenApi types | |
| id: check_typescript_openapi | |
| uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 | |
| with: | |
| files: "src/types/openapi/openapi*.ts" | |
| - name: Read package.json node and npm engines version | |
| if: steps.check_typescript_openapi.outputs.files_exists == 'true' | |
| uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 | |
| id: node_versions | |
| # Continue if no package.json | |
| continue-on-error: true | |
| with: | |
| fallbackNode: '^24' | |
| fallbackNpm: '^11.3' | |
| - name: Set up node ${{ steps.node_versions.outputs.nodeVersion }} | |
| if: ${{ steps.node_versions.outputs.nodeVersion }} | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: ${{ steps.node_versions.outputs.nodeVersion }} | |
| - name: Set up npm ${{ steps.node_versions.outputs.npmVersion }} | |
| if: ${{ steps.node_versions.outputs.nodeVersion }} | |
| run: npm i -g 'npm@${{ steps.node_versions.outputs.npmVersion }}' | |
| - name: Install dependencies | |
| if: ${{ steps.node_versions.outputs.nodeVersion }} | |
| 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 and typescript changes | |
| run: | | |
| bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please run \"composer run openapi\" and commit the openapi*.json files and (if applicable) src/types/openapi/openapi*.ts, see the section \"Show changes on failure\" for details' && exit 1)" | |
| - name: Show changes on failure | |
| if: failure() | |
| run: | | |
| git status | |
| git --no-pager diff | |
| exit 1 # make it red to grab attention |