Skip to content

Commit e0c282d

Browse files
Merge pull request #58195 from nextcloud/ci/rector-apply
ci: Add workflow to apply rector changes weekly
2 parents d65aa0b + 0469f57 commit e0c282d

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/rector-apply.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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: 2026 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Apply rector changes
10+
11+
on:
12+
workflow_dispatch:
13+
schedule:
14+
# At 14:30 on Sundays
15+
- cron: '30 14 * * 0'
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
24+
name: rector-apply
25+
26+
steps:
27+
- name: Checkout
28+
id: checkout
29+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
with:
31+
persist-credentials: false
32+
ref: ${{ github.event.repository.default_branch }}
33+
34+
- name: Get php version
35+
id: versions
36+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
37+
38+
- name: Set up php${{ steps.versions.outputs.php-min }}
39+
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2.36.0
40+
with:
41+
php-version: ${{ steps.versions.outputs.php-min }}
42+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
43+
coverage: none
44+
ini-file: development
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Install dependencies
49+
run: |
50+
composer remove nextcloud/ocp --dev --no-scripts
51+
composer i
52+
53+
- name: Rector
54+
run: composer run rector
55+
56+
- name: Create Pull Request
57+
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
58+
with:
59+
token: ${{ secrets.COMMAND_BOT_PAT }}
60+
commit-message: 'refactor: Apply rector changes'
61+
committer: GitHub <noreply@github.com>
62+
author: nextcloud-command <nextcloud-command@users.noreply.github.com>
63+
signoff: true
64+
branch: automated/noid/rector-changes
65+
title: 'Apply rector changes'
66+
labels: |
67+
technical debt
68+
3. to review

0 commit comments

Comments
 (0)