From 0469f57a3a740a4f9fc2459edab32b31f941c0be Mon Sep 17 00:00:00 2001 From: provokateurin Date: Mon, 9 Feb 2026 11:22:53 +0100 Subject: [PATCH] ci: Add workflow to apply rector changes weekly Signed-off-by: provokateurin --- .github/workflows/rector-apply.yml | 68 ++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/rector-apply.yml diff --git a/.github/workflows/rector-apply.yml b/.github/workflows/rector-apply.yml new file mode 100644 index 0000000000000..8bbea3450d7d6 --- /dev/null +++ b/.github/workflows/rector-apply.yml @@ -0,0 +1,68 @@ +# 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: 2026 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT + +name: Apply rector changes + +on: + workflow_dispatch: + schedule: + # At 14:30 on Sundays + - cron: '30 14 * * 0' + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + name: rector-apply + + steps: + - name: Checkout + id: checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + ref: ${{ github.event.repository.default_branch }} + + - name: Get php version + id: versions + uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 + + - name: Set up php${{ steps.versions.outputs.php-min }} + uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2.36.0 + with: + php-version: ${{ steps.versions.outputs.php-min }} + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite + coverage: none + ini-file: development + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Install dependencies + run: | + composer remove nextcloud/ocp --dev --no-scripts + composer i + + - name: Rector + run: composer run rector + + - name: Create Pull Request + uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 + with: + token: ${{ secrets.COMMAND_BOT_PAT }} + commit-message: 'refactor: Apply rector changes' + committer: GitHub + author: nextcloud-command + signoff: true + branch: automated/noid/rector-changes + title: 'Apply rector changes' + labels: | + technical debt + 3. to review