Skip to content

Commit 72ee219

Browse files
ci(actions): Update workflow templates from organization template repository
Signed-off-by: GitHub <noreply@github.com>
1 parent de84bc3 commit 72ee219

3 files changed

Lines changed: 75 additions & 7 deletions

File tree

.github/actions-lock.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: MIT
3+
9f2b534bea27e8ec2dda7c1d772a664b block-merge-eol.yml
4+
2581a67c5bcdcd570427e6d51db767d7 fixup.yml
5+
372b684975a822d0d1298892177ca7a9 openapi.yml
6+
3c4a096b3b7dbaef0f8e5190ffe13518 pr-feedback.yml

.github/workflows/block-merge-eol.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
steps:
2929
- name: Set server major version environment
30-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
30+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
3131
with:
3232
github-token: ${{secrets.GITHUB_TOKEN}}
3333
script: |

.github/workflows/openapi.yml

Lines changed: 68 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-FileCopyrightText: 2024 Arthur Schiwon <blizzz@arthur-schiwon.de>
8+
# SPDX-License-Identifier: MIT
9+
110
name: OpenAPI
211

312
on: pull_request
@@ -13,22 +22,75 @@ jobs:
1322
openapi:
1423
runs-on: ubuntu-latest
1524

25+
if: ${{ github.repository_owner != 'nextcloud-gmbh' }}
26+
1627
steps:
1728
- name: Checkout
1829
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1930
with:
2031
persist-credentials: false
2132

33+
- name: Get php version
34+
id: php_versions
35+
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2
36+
2237
- name: Set up php
23-
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # v2
38+
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
2439
with:
25-
php-version: '8.1'
26-
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
27-
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib
40+
php-version: ${{ steps.php_versions.outputs.php-available }}
41+
extensions: xml
2842
coverage: none
2943
ini-file: development
3044
env:
3145
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3246

33-
- name: Build using Makefile
34-
run: make openapi-spec
47+
- name: Check Typescript OpenApi types
48+
id: check_typescript_openapi
49+
uses: andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0
50+
with:
51+
files: "src/types/openapi/openapi*.ts"
52+
53+
- name: Read package.json node and npm engines version
54+
if: steps.check_typescript_openapi.outputs.files_exists == 'true'
55+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
56+
id: node_versions
57+
# Continue if no package.json
58+
continue-on-error: true
59+
with:
60+
fallbackNode: '^24'
61+
fallbackNpm: '^11.3'
62+
63+
- name: Set up node ${{ steps.node_versions.outputs.nodeVersion }}
64+
if: ${{ steps.node_versions.outputs.nodeVersion }}
65+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
66+
with:
67+
node-version: ${{ steps.node_versions.outputs.nodeVersion }}
68+
69+
- name: Set up npm ${{ steps.node_versions.outputs.npmVersion }}
70+
if: ${{ steps.node_versions.outputs.nodeVersion }}
71+
run: npm i -g 'npm@${{ steps.node_versions.outputs.npmVersion }}'
72+
73+
- name: Install dependencies
74+
if: ${{ steps.node_versions.outputs.nodeVersion }}
75+
env:
76+
CYPRESS_INSTALL_BINARY: 0
77+
PUPPETEER_SKIP_DOWNLOAD: true
78+
run: |
79+
npm ci
80+
81+
- name: Set up dependencies
82+
run: composer i
83+
84+
- name: Regenerate OpenAPI
85+
run: composer run openapi
86+
87+
- name: Check openapi*.json and typescript changes
88+
run: |
89+
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)"
90+
91+
- name: Show changes on failure
92+
if: failure()
93+
run: |
94+
git status
95+
git --no-pager diff
96+
exit 1 # make it red to grab attention

0 commit comments

Comments
 (0)