Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/actions-lock.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
fe1239ed98a163abbdea3e0490c85458 appstore-build-publish.yml
19ab9c47c8d96de93f37fab242c398cc block-unconventional-commits.yml
e6351c608939c31ae1e32923aa82aa10 dependabot-approve-merge.yml
985f3ac7d51405c1601c742832a14120 lint-eslint.yml
43fd0c5fb704cabc5f11cdfaf513236d lint-info-xml.yml
4b40dd0073e16f74dd04e6d49dcc043d lint-php-cs.yml
cfb31e47b6e9ab65e76c89b028754a4e lint-php.yml
ab3a506506b1d7c1cea9593ecfd84366 lint-stylelint.yml
97773e8d73758d9f1af50f7c8b82aef3 lint-typescript.yml
3b1f38e378f8e764b0b3c560a8cfe1cd node-test.yml
03759c9dc0fa748cb927b9f9cadf2925 node.yml
0dc931ec237a235370e224282608b20e npm-audit-fix.yml
65678bf15deefb099dea5410459a7c17 openapi.yml
076e72a19e7bdf35ac5b2abee0198c43 phpunit-mariadb.yml
8fab08ac7da700ee304af0bf3c18b3a3 phpunit-mysql.yml
256bf1dead4ef8479e9ce7433f871548 phpunit-pgsql.yml
4ca2c2c4b1a73182667bab908e57c185 phpunit-sqlite.yml
6dc046dfbca5dc65d938265c518fcac4 psalm.yml
2dbec18233063b42f4d8e03bbb43671c reuse.yml
b47a9fe981a7435caea92db33f5ad121 sync-workflow-templates.yml
a3440826636c0fd7c2d20b1de50363da update-nextcloud-ocp-approve-merge.yml
1919e2ff468e875aeeae5fd088d4ce1f update-nextcloud-ocp.yml
22604c31b526de270a080eb19967a638 update-stable-titles.yml
8 changes: 5 additions & 3 deletions .github/workflows/appstore-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ jobs:

- name: Install composer dependencies
if: steps.check_composer.outputs.files_exists == 'true'
run: |
cd ${{ env.APP_NAME }}
composer install --no-dev
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
with:
composer-options: '--no-dev'
working-directory: ${{ env.APP_NAME }}
ignore-cache: 'yes'

- name: Build ${{ env.APP_NAME }}
# Skip if no package.json
Expand Down
72 changes: 62 additions & 10 deletions .github/workflows/dependabot-approve-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Dependabot
name: Auto approve Dependabot PRs

on:
pull_request_target: # zizmor: ignore[dangerous-triggers]
Expand All @@ -24,11 +24,20 @@ concurrency:

jobs:
auto-approve-merge:
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]'
if: github.event.pull_request.user.login == 'dependabot[bot]'
runs-on: ubuntu-latest
env:
# env variable for maintainers: 'true' allows to auto-merge 1.0.2 -> 2.0.0
ALLOW_MAJOR: false
# env variable for maintainers: 'true' allows to auto-merge 1.0.2 -> 1.1.0
ALLOW_MINOR: true
# env variable for maintainers: RegExp string to ignore some dependencies from auto-approve and auto-merge
IGNORE_PATTERN: ''
permissions:
# for hmarr/auto-approve-action to approve PRs
# for auto-approve step to work
pull-requests: write
# for alexwilson/enable-github-automerge-action to approve PRs
contents: write

steps:
- name: Disabled on forks
Expand All @@ -37,13 +46,56 @@ jobs:
echo 'Can not approve PRs from forks'
exit 1

# GitHub actions bot approve
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
- uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0
id: branchname
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Dependabot metadata
id: metadata
if: startsWith(steps.branchname.outputs.branch, 'dependabot/')
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

# Nextcloud bot approve and merge request
- uses: ahmadnassri/action-dependabot-auto-merge@45fc124d949b19b6b8bf6645b6c9d55f4f9ac61a # v2
- name: Check for ignored dependencies in the PR
id: validate
if: startsWith(steps.branchname.outputs.branch, 'dependabot/')
env:
IGNORE_PATTERN: ${{ env.IGNORE_PATTERN }}
DEPENDENCY_NAMES: ${{ steps.metadata.outputs.dependency-names }}
run: |
if [[ -z ${IGNORE_PATTERN} ]]; then
echo "ignore=false" >> "$GITHUB_OUTPUT"
elif [[ -z ${DEPENDENCY_NAMES} ]]; then
echo "ignore=false" >> "$GITHUB_OUTPUT"
elif [[ ${DEPENDENCY_NAMES} =~ ${IGNORE_PATTERN} ]]; then
echo "ignore=true" >> "$GITHUB_OUTPUT"
fi

- name: GitHub actions bot approve
id: auto_approve
if: ${{
startsWith(steps.branchname.outputs.branch, 'dependabot/')
&& steps.validate.outputs.ignore != 'true'
}}
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Enable GitHub auto merge
- name: Auto merge
uses: alexwilson/enable-github-automerge-action@2c32e18a76e0726ffe7a573bfff2d42a20885126 # 3.0.0
if: ${{
startsWith(steps.branchname.outputs.branch, 'dependabot/')
&& steps.auto_approve.conclusion == 'success'
&& (github.event.action == 'opened' || github.event.action == 'reopened')
&& (
steps.metadata.outputs.update-type == 'version-update:semver-patch'
|| (fromJSON(env.ALLOW_MINOR) && steps.metadata.outputs.update-type == 'version-update:semver-minor')
|| (fromJSON(env.ALLOW_MAJOR) && steps.metadata.outputs.update-type == 'version-update:semver-major')
)
}}
with:
target: minor
github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/lint-eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
src: ${{ steps.changes.outputs.src}}

steps:
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
id: changes
continue-on-error: true
with:
Expand Down Expand Up @@ -64,8 +64,8 @@ jobs:
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
id: versions
with:
fallbackNode: '^20'
fallbackNpm: '^10'
fallbackNode: '^24'
fallbackNpm: '^11.3'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint-info-xml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
sparse-checkout: |
appinfo/

- name: Download schema
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Get php version
id: versions
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2.3.1.3.2
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2

- name: Set up php${{ steps.versions.outputs.php-min }}
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
Expand All @@ -44,10 +44,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
- name: Remove nextcloud/ocp
run: |
composer remove nextcloud/ocp --dev --no-scripts
composer i

- name: Install composer dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0

- name: Lint
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
7 changes: 4 additions & 3 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
matrix:
runs-on: ubuntu-latest
outputs:
php-versions: ${{ steps.versions.outputs.php-versions }}
php-min: ${{ steps.versions.outputs.php-min }}
php-max: ${{ steps.versions.outputs.php-max }}
steps:
- name: Checkout app
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
Expand All @@ -30,14 +31,14 @@ jobs:

- name: Get version matrix
id: versions
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.0.0
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2

php-lint:
runs-on: ubuntu-latest
needs: matrix
strategy:
matrix:
php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}}
php-versions: ['${{ needs.matrix.outputs.php-min }}', '${{ needs.matrix.outputs.php-max }}']

name: php-lint

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-stylelint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
id: versions
with:
fallbackNode: '^20'
fallbackNpm: '^10'
fallbackNode: '^24'
fallbackNpm: '^11.3'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
src: ${{ steps.changes.outputs.src}}

steps:
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
id: changes
continue-on-error: true
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
src: ${{ steps.changes.outputs.src}}

steps:
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
id: changes
continue-on-error: true
with:
Expand Down Expand Up @@ -110,4 +110,3 @@ jobs:
steps:
- name: Summary status
run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi

6 changes: 4 additions & 2 deletions .github/workflows/npm-audit-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
matrix:
branches:
- ${{ github.event.repository.default_branch }}
- 'stable35'
- 'stable34'
- 'stable33'
- 'stable32'

Expand All @@ -44,8 +46,8 @@ jobs:
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
id: versions
with:
fallbackNode: '^20'
fallbackNpm: '^10'
fallbackNode: '^24'
fallbackNpm: '^11.3'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/node.yml → .github/workflows/npm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Node
name: Build Javascript

on: pull_request

Expand All @@ -28,7 +28,7 @@ jobs:
src: ${{ steps.changes.outputs.src}}

steps:
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
id: changes
continue-on-error: true
with:
Expand Down Expand Up @@ -61,8 +61,8 @@ jobs:
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
id: versions
with:
fallbackNode: '^20'
fallbackNpm: '^10'
fallbackNode: '^24'
fallbackNpm: '^11.3'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
Expand All @@ -72,6 +72,12 @@ jobs:
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'

- name: Validate package-lock.json # See https://github.com/npm/cli/issues/4460
run: |
npm i -g npm-package-lock-add-resolved@1.1.4
npm-package-lock-add-resolved
git --no-pager diff --exit-code

- name: Install dependencies & build
env:
CYPRESS_INSTALL_BINARY: 0
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Get php version
id: php_versions
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2.3.1.3.2
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2

- name: Set up php
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
Expand All @@ -58,8 +58,8 @@ jobs:
# Continue if no package.json
continue-on-error: true
with:
fallbackNode: '^20'
fallbackNpm: '^10'
fallbackNode: '^24'
fallbackNpm: '^11.3'

- name: Set up node ${{ steps.node_versions.outputs.nodeVersion }}
if: ${{ steps.node_versions.outputs.nodeVersion }}
Expand All @@ -79,18 +79,19 @@ jobs:
run: |
npm ci

- name: Set up dependencies
run: composer i
- name: Install composer dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0

- name: Regenerate OpenAPI
run: composer run openapi

- name: Check openapi*.json and typescript changes
run: |
git diff --quiet -- openapi*.json src/types/openapi/openapi*.ts || (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)
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 --no-pager diff -- openapi*.json src/types/openapi/openapi*.ts
git status
git --no-pager diff
exit 1 # make it red to grab attention
Loading
Loading