@@ -21,30 +21,25 @@ jobs:
2121 update-nextcloud-ocp :
2222 runs-on : ubuntu-latest
2323
24- strategy :
25- fail-fast : false
26- matrix :
27- branches :
28- - ${{ github.event.repository.default_branch }}
29- - ' stable32'
30- - ' stable31'
24+ # Only allowed to be run on nextcloud repositories
25+ if : ${{ github.repository_owner == 'nextcloud' }}
3126
32- name : update-nextcloud-ocp-${{ matrix.branches }}
27+ name : update-nextcloud-ocp-main
3328
3429 steps :
3530 - id : checkout
3631 uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
3732 with :
3833 persist-credentials : false
39- ref : ${{ matrix.branches }}
34+ ref : main
4035 submodules : true
4136 continue-on-error : true
4237
43- - name : Set up php8.2
38+ - name : Set up php8.3
4439 if : steps.checkout.outcome == 'success'
45- uses : shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2 .37.2
40+ uses : shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2 .37.2
4641 with :
47- php-version : 8.2
42+ php-version : 8.3
4843 # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
4944 extensions : bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
5045 coverage : none
@@ -62,53 +57,39 @@ jobs:
6257 if : steps.checkout.outcome == 'success'
6358 run : composer install
6459
65- - name : Composer update nextcloud/ocp # zizmor: ignore[template-injection]
66- id : update_branch
67- if : ${{ steps.checkout.outcome == 'success' && matrix.branches != 'main' }}
68- run : composer require --dev 'nextcloud/ocp:dev-${{ matrix.branches }}'
69-
70- - name : Raise on issue on failure
71- uses : dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0
72- if : ${{ steps.checkout.outcome == 'success' && failure() && steps.update_branch.conclusion == 'failure' }}
60+ - name : Check composer bin for nextcloud/ocp exists
61+ id : check_composer_bin
62+ uses : andstor/file-existence-action@558493d6c74bf472d87c84eab196434afc2fa029 # v3.1.0
7363 with :
74- token : ${{ secrets.GITHUB_TOKEN }}
75- title : ' Failed to update nextcloud/ocp package on branch ${{ matrix.branches }}'
76- body : ' Please check the output of the GitHub action and manually resolve the issues<br>${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}<br>${{ steps.codeowners.outputs.codeowners }}'
64+ files : vendor-bin/nextcloud-ocp/composer.json
7765
7866 - name : Composer update nextcloud/ocp
79- id : update_main
80- if : ${{ steps.checkout.outcome == 'success' && matrix.branches == 'main' }}
81- run : composer require --dev nextcloud/ocp:dev-master
67+ id : update_branch
68+ env :
69+ USE_COMPOSER_BIN : ${{ steps.check_composer_bin.outputs.files_exists }}
70+ BRANCH_NAME : main
71+ run : |
72+ COMPOSER_CMD='composer'
73+ if [[ "$USE_COMPOSER_BIN" == 'true' ]]; then
74+ COMPOSER_CMD='composer bin nextcloud-ocp'
75+ fi
76+
77+ PACKAGE_VERSION="nextcloud/ocp:dev-$BRANCH_NAME"
78+ if [[ "$BRANCH_NAME" == 'main' ]]; then
79+ PACKAGE_VERSION='nextcloud/ocp:dev-master'
80+ fi
81+
82+ echo $COMPOSER_CMD require --dev $PACKAGE_VERSION
83+ $COMPOSER_CMD require --dev $PACKAGE_VERSION
8284
8385 - name : Raise on issue on failure
8486 uses : dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0
85- if : ${{ steps.checkout.outcome == 'success' && failure() && steps.update_main .conclusion == 'failure' }}
87+ if : ${{ steps.checkout.outcome == 'success' && failure() && steps.update_branch .conclusion == 'failure' }}
8688 with :
8789 token : ${{ secrets.GITHUB_TOKEN }}
88- title : ' Failed to update nextcloud/ocp package on branch ${{ matrix.branches }} '
90+ title : ' Failed to update nextcloud/ocp package on branch main '
8991 body : ' Please check the output of the GitHub action and manually resolve the issues<br>${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}<br>${{ steps.codeowners.outputs.codeowners }}'
9092
91- - name : Reset checkout 3rdparty
92- if : steps.checkout.outcome == 'success'
93- run : |
94- git clean -f 3rdparty
95- git checkout 3rdparty
96- continue-on-error : true
97-
98- - name : Reset checkout vendor
99- if : steps.checkout.outcome == 'success'
100- run : |
101- git clean -f vendor
102- git checkout vendor
103- continue-on-error : true
104-
105- - name : Reset checkout vendor-bin
106- if : steps.checkout.outcome == 'success'
107- run : |
108- git clean -f vendor-bin
109- git checkout vendor-bin
110- continue-on-error : true
111-
11293 - name : Create Pull Request
11394 if : steps.checkout.outcome == 'success'
11495 uses : peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
@@ -118,8 +99,13 @@ jobs:
11899 committer : GitHub <noreply@github.com>
119100 author : nextcloud-command <nextcloud-command@users.noreply.github.com>
120101 signoff : true
121- branch : ' automated/noid/${{ matrix.branches }}-update-nextcloud-ocp'
122- title : ' [${{ matrix.branches }}] Update nextcloud/ocp dependency'
102+ branch : ' automated/noid/main-update-nextcloud-ocp'
103+ title : ' [main] Update nextcloud/ocp dependency'
104+ add-path : |
105+ composer.json
106+ composer.lock
107+ vendor-bin/nextcloud-ocp/composer.json
108+ vendor-bin/nextcloud-ocp/composer.lock
123109 body : |
124110 Auto-generated update of [nextcloud/ocp](https://github.com/nextcloud-deps/ocp/) dependency
125111 labels : |
0 commit comments