Skip to content

ci(gh): Sync actions #53069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 23, 2025
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
23 changes: 16 additions & 7 deletions .github/workflows/block-merge-eol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,22 @@ jobs:

steps:
- name: Set server major version environment
run: |
# retrieve version number from branch reference
server_major=$(echo "${{ github.base_ref }}" | sed -En 's/stable//p')
echo "server_major=$server_major" >> $GITHUB_ENV
echo "current_month=$(date +%Y-%m)" >> $GITHUB_ENV
- name: Checking if ${{ env.server_major }} is EOL
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const regex = /^stable(\d+)$/
const baseRef = context.payload.pull_request.base.ref
const match = baseRef.match(regex)
if (match) {
console.log('Setting server_major to ' + match[1]);
core.exportVariable('server_major', match[1]);
console.log('Setting current_month to ' + (new Date()).toISOString().substr(0, 7));
core.exportVariable('current_month', (new Date()).toISOString().substr(0, 7));
}
- name: Checking if server ${{ env.server_major }} is EOL
if: ${{ env.server_major != '' }}
run: |
curl -s https://raw.githubusercontent.com/nextcloud-releases/updater_server/production/config/major_versions.json \
| jq '.["${{ env.server_major }}"]["eol"] // "9999-99" | . >= "${{ env.current_month }}"' \
Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/block-merge-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,30 @@ jobs:
runs-on: ubuntu-latest-low

steps:
- name: Download version.php from ${{ github.base_ref }}
run: curl 'https://raw.githubusercontent.com/nextcloud/server/${{ github.base_ref }}/version.php' --output version.php
- name: Register server reference to fallback to master branch
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const baseRef = context.payload.pull_request.base.ref
if (baseRef === 'main' || baseRef === 'master') {
core.exportVariable('server_ref', 'master');
console.log('Setting server_ref to master');
} else {
const regex = /^stable(\d+)$/
const match = baseRef.match(regex)
if (match) {
core.exportVariable('server_ref', match[0]);
console.log('Setting server_ref to ' + match[0]);
} else {
console.log('Not based on master/main/stable*, so skipping freeze check');
}
}
- name: Download version.php from ${{ env.server_ref }}
if: ${{ env.server_ref != '' }}
run: curl 'https://raw.githubusercontent.com/nextcloud/server/${{ env.server_ref }}/version.php' --output version.php

- name: Run check
if: ${{ env.server_ref != '' }}
run: cat version.php | grep 'OC_VersionString' | grep -i -v 'RC'
26 changes: 24 additions & 2 deletions .github/workflows/block-outdated-3rdparty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,44 @@ jobs:

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: 3rdparty commit hash on current branch
id: actual
run: |
echo "commit=$(git submodule status | grep ' 3rdparty' | egrep -o '[a-f0-9]{40}')" >> "$GITHUB_OUTPUT"

- name: Register server reference to fallback to master branch
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const baseRef = context.payload.pull_request.base.ref
if (baseRef === 'main' || baseRef === 'master') {
core.exportVariable('server_ref', 'master');
console.log('Setting server_ref to master');
} else {
const regex = /^stable(\d+)$/
const match = baseRef.match(regex)
if (match) {
core.exportVariable('server_ref', match[0]);
console.log('Setting server_ref to ' + match[0]);
} else {
console.log('Not based on master/main/stable*, so skipping freeze check');
}
}

- name: Last 3rdparty commit on target branch
id: target
run: |
echo "commit=$(git ls-remote https://github.com/nextcloud/3rdparty refs/heads/${{ github.base_ref }} | awk '{ print $1}')" >> "$GITHUB_OUTPUT"
echo "commit=$(git ls-remote https://github.com/nextcloud/3rdparty refs/heads/${{ env.server_ref }} | awk '{ print $1}')" >> "$GITHUB_OUTPUT"

- name: Compare if 3rdparty commits are different
run: |
echo '3rdparty/ seems to not point to the last commit of the dedicated branch:'
echo 'Branch has: ${{ steps.actual.outputs.commit }}'
echo '${{ github.base_ref }} has: ${{ steps.target.outputs.commit }}'
echo '${{ env.server_ref }} has: ${{ steps.target.outputs.commit }}'

- name: Fail if 3rdparty commits are different
if: ${{ steps.changes.outputs.src != 'false' && steps.actual.outputs.commit != steps.target.outputs.commit }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/block-unconventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: webiny/action-conventional-commits@8bc41ff4e7d423d56fa4905f6ff79209a78776c7 # v1.3.0
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/command-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
issue_comment:
types: [created]

permissions:
contents: read

jobs:
init:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -102,6 +105,7 @@ jobs:
- name: Checkout ${{ needs.init.outputs.head_ref }}
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Needed to allow force push later
persist-credentials: true
token: ${{ secrets.COMMAND_BOT_PAT }}
fetch-depth: 0
Expand Down
38 changes: 35 additions & 3 deletions .github/workflows/command-pull-3rdparty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,56 @@ jobs:
id: comment-branch

- name: Checkout ${{ steps.comment-branch.outputs.head_ref }}
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
fetch-depth: 0
token: ${{ secrets.COMMAND_BOT_PAT }}
ref: ${{ steps.comment-branch.outputs.head_ref }}

- name: Register server reference to fallback to master branch
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const baseRef = context.payload.pull_request.base.ref
if (baseRef === 'main' || baseRef === 'master') {
core.exportVariable('server_ref', 'master');
console.log('Setting server_ref to master');
} else {
const regex = /^stable(\d+)$/
const match = baseRef.match(regex)
if (match) {
core.exportVariable('server_ref', match[0]);
console.log('Setting server_ref to ' + match[0]);
} else {
console.log('Not based on master/main/stable*, so skipping freeze check');
}
}
- name: Setup git
run: |
git config --local user.email '[email protected]'
git config --local user.name 'nextcloud-command'
- name: Add reaction on failure
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v3.0.1
if: ${{ env.server_ref == '' }}
with:
token: ${{ secrets.COMMAND_BOT_PAT }}
repository: ${{ github.event.repository.full_name }}
comment-id: ${{ github.event.comment.id }}
reactions: '-1'

- name: Pull 3rdparty
run: git submodule foreach 'if [ "$sm_path" == "3rdparty" ]; then git pull origin '"'"'${{ github.event.issue.pull_request.base.ref }}'"'"'; fi'
if: ${{ env.server_ref != '' }}
run: git submodule foreach 'if [ "$sm_path" == "3rdparty" ]; then git pull origin '"'"'${{ env.server_ref }}'"'"'; fi'

- name: Commit and push changes
if: ${{ env.server_ref != '' }}
run: |
git add 3rdparty
git commit -s -m 'Update submodule 3rdparty to latest ${{ github.event.issue.pull_request.base.ref }}'
git commit -s -m 'Update submodule 3rdparty to latest ${{ env.server_ref }}'
git push
- name: Add reaction on failure
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ env:
# Adjust APP_NAME if your repository name is different
APP_NAME: ${{ github.event.repository.name }}

# Server requires head_ref instead of base_ref, as we want to test the PR branch
# This represents the server branch to checkout.
# Usually it's the base branch of the PR, but for pushes it's the branch itself.
# e.g. 'main', 'stable27' or 'feature/my-feature'
# n.b. server will use head_ref, as we want to test the PR branch.
BRANCH: ${{ github.head_ref || github.ref_name }}


permissions:
contents: read

jobs:
init:
runs-on: ubuntu-latest
Expand All @@ -43,6 +50,7 @@ jobs:
- name: Checkout server
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
# We need to checkout submodules for 3rdparty
submodules: true

Expand Down Expand Up @@ -80,7 +88,7 @@ jobs:
run: npm run cypress:version

- name: Save context
uses: buildjet/cache/save@v4
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
with:
key: cypress-context-${{ github.run_id }}
path: ./
Expand Down Expand Up @@ -148,7 +156,7 @@ jobs:

steps:
- name: Restore context
uses: buildjet/cache/restore@v4
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
with:
fail-on-cache-miss: true
key: cypress-context-${{ github.run_id }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependabot-approve-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
name: Dependabot

on:
pull_request_target:
pull_request_target: # zizmor: ignore[dangerous-triggers]
branches:
- main
- master
Expand All @@ -24,7 +24,7 @@ concurrency:

jobs:
auto-approve-merge:
if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]'
runs-on: ubuntu-latest-low
permissions:
# for hmarr/auto-approve-action to approve PRs
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/files-external-ftp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
schedule:
- cron: "5 2 * * *"

permissions:
contents: read

concurrency:
group: files-external-ftp-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Expand Down Expand Up @@ -53,8 +56,9 @@ jobs:

steps:
- name: Checkout server
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true

- name: Set up ftpd
Expand Down Expand Up @@ -101,7 +105,7 @@ jobs:

- name: Upload code coverage
if: ${{ !cancelled() && matrix.coverage }}
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
files: ./clover.xml
flags: phpunit-files-external-ftp
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/files-external-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
schedule:
- cron: "5 2 * * *"

permissions:
contents: read

concurrency:
group: files-external-s3-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Expand Down Expand Up @@ -50,7 +53,7 @@ jobs:

services:
minio:
image: bitnami/minio
image: bitnami/minio@sha256:50cec18ac4184af4671a78aedd5554942c8ae105d51a465fa82037949046da01 # v2025.4.22
env:
MINIO_ROOT_USER: nextcloud
MINIO_ROOT_PASSWORD: bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ=
Expand All @@ -60,8 +63,9 @@ jobs:

steps:
- name: Checkout server
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true

- name: Set up php ${{ matrix.php-versions }}
Expand Down Expand Up @@ -99,7 +103,7 @@ jobs:

- name: Upload code coverage
if: ${{ !cancelled() && matrix.coverage }}
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
files: ./clover.xml
flags: phpunit-files-external-s3
Expand Down Expand Up @@ -136,14 +140,15 @@ jobs:
env:
SERVICES: s3
DEBUG: 1
image: localstack/localstack
image: localstack/localstack@sha256:b52c16663c70b7234f217cb993a339b46686e30a1a5d9279cb5feeb2202f837c # v4.4.0
ports:
- "4566:4566"

steps:
- name: Checkout server
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true

- name: Set up php ${{ matrix.php-versions }}
Expand Down Expand Up @@ -173,7 +178,7 @@ jobs:

- name: Upload code coverage
if: ${{ !cancelled() && matrix.coverage }}
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
files: ./clover.xml
flags: phpunit-files-external-s3
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/files-external-sftp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
schedule:
- cron: "5 2 * * *"

permissions:
contents: read

concurrency:
group: files-external-sftp-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Expand Down Expand Up @@ -53,8 +56,9 @@ jobs:

steps:
- name: Checkout server
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true

- name: Set up sftpd
Expand Down Expand Up @@ -90,7 +94,7 @@ jobs:

- name: Upload code coverage
if: ${{ !cancelled() && matrix.coverage }}
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
files: ./clover.xml
flags: phpunit-files-external-sftp
Expand Down
Loading
Loading