diff --git a/.github/workflows/update-nextcloud-ocp.yml b/.github/workflows/update-nextcloud-ocp-matrix.yml
similarity index 63%
rename from .github/workflows/update-nextcloud-ocp.yml
rename to .github/workflows/update-nextcloud-ocp-matrix.yml
index c858850..9bea1f3 100644
--- a/.github/workflows/update-nextcloud-ocp.yml
+++ b/.github/workflows/update-nextcloud-ocp-matrix.yml
@@ -11,10 +11,11 @@ name: Update nextcloud/ocp
on:
workflow_dispatch:
schedule:
- - cron: "5 2 * * 0"
+ - cron: '5 2 * * 0'
permissions:
contents: read
+ issues: write
jobs:
update-nextcloud-ocp:
@@ -23,22 +24,24 @@ jobs:
strategy:
fail-fast: false
matrix:
- branches: ['main', 'master', 'stable31', 'stable30']
+ branches:
+ - ${{ github.event.repository.default_branch }}
name: update-nextcloud-ocp-${{ matrix.branches }}
steps:
- - id: checkout
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
ref: ${{ matrix.branches }}
submodules: true
- continue-on-error: true
+
+ - name: Get version matrix
+ id: versions
+ uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
- name: Set up php8.2
- if: steps.checkout.outcome == 'success'
- uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
+ uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
with:
php-version: 8.2
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
@@ -48,65 +51,45 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Read codeowners
- if: steps.checkout.outcome == 'success'
id: codeowners
run: |
grep '/appinfo/info.xml' .github/CODEOWNERS | cut -f 2- -d ' ' | xargs | awk '{ print "codeowners="$0 }' >> $GITHUB_OUTPUT
continue-on-error: true
- name: Composer install
- if: steps.checkout.outcome == 'success'
run: composer install
- name: Composer update nextcloud/ocp
id: update_branch
- if: ${{ steps.checkout.outcome == 'success' && matrix.branches != 'main' }}
- run: composer require --dev 'nextcloud/ocp:dev-${{ matrix.branches }}'
-
- - name: Raise on issue on failure
- uses: dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0
- if: ${{ steps.checkout.outcome == 'success' && failure() && steps.update_branch.conclusion == 'failure' }}
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- title: 'Failed to update nextcloud/ocp package on branch ${{ matrix.branches }}'
- body: 'Please check the output of the GitHub action and manually resolve the issues
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
${{ steps.codeowners.outputs.codeowners }}'
-
- - name: Composer update nextcloud/ocp
- id: update_main
- if: ${{ steps.checkout.outcome == 'success' && matrix.branches == 'main' }}
- run: composer require --dev nextcloud/ocp:dev-master
+ run: composer require --dev nextcloud/ocp:dev-${{ steps.versions.outputs.branches-min }}
- name: Raise on issue on failure
uses: dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0
- if: ${{ steps.checkout.outcome == 'success' && failure() && steps.update_main.conclusion == 'failure' }}
+ if: ${{ failure() && steps.update_branch.conclusion == 'failure' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
- title: 'Failed to update nextcloud/ocp package on branch ${{ matrix.branches }}'
+ title: 'Failed to update nextcloud/ocp package'
body: 'Please check the output of the GitHub action and manually resolve the issues
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
${{ steps.codeowners.outputs.codeowners }}'
- name: Reset checkout 3rdparty
- if: steps.checkout.outcome == 'success'
run: |
git clean -f 3rdparty
git checkout 3rdparty
continue-on-error: true
- name: Reset checkout vendor
- if: steps.checkout.outcome == 'success'
run: |
git clean -f vendor
git checkout vendor
continue-on-error: true
- name: Reset checkout vendor-bin
- if: steps.checkout.outcome == 'success'
run: |
git clean -f vendor-bin
git checkout vendor-bin
continue-on-error: true
- name: Create Pull Request
- if: steps.checkout.outcome == 'success'
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.COMMAND_BOT_PAT }}