Skip to content
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
36 changes: 36 additions & 0 deletions .github/workflows/fixup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Block fixup and squash commits

on:
pull_request:
types: [opened, ready_for_review, reopened, synchronize]

permissions:
contents: read

concurrency:
group: fixup-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
commit-message-check:
if: github.event.pull_request.draft == false

permissions:
pull-requests: write
name: Block fixup and squash commits

runs-on: ubuntu-latest-low

steps:
- name: Run check
uses: skjnldsv/block-fixup-merge-action@c138ea99e45e186567b64cf065ce90f7158c236a # v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
50 changes: 50 additions & 0 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Lint php-cs

on: pull_request

permissions:
contents: read

concurrency:
group: lint-php-cs-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest

name: php-cs

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up php8.4
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: 8.4
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: Remove nextcloud/ocp
run: |
composer remove nextcloud/ocp --dev --no-scripts

- name: Install composer dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0

- name: Lint
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
21 changes: 21 additions & 0 deletions .github/workflows/lint-php-cs.yml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml
index 06d0842..0f61391 100644
--- a/.github/workflows/lint-php-cs.yml
+++ b/.github/workflows/lint-php-cs.yml
@@ -29,14 +29,10 @@ jobs:
with:
persist-credentials: false

- - name: Get php version
- id: versions
- uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3
-
- - name: Set up php${{ steps.versions.outputs.php-min }}
+ - name: Set up php8.4
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
- php-version: ${{ steps.versions.outputs.php-min }}
+ php-version: 8.4
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
54 changes: 54 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Static analysis

on: pull_request

concurrency:
group: psalm-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
static-analysis:
runs-on: ubuntu-latest

name: static-psalm-analysis
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Check enforcement of minimum PHP version 8.4 in psalm.xml
run: grep 'phpVersion="8.4"' psalm.xml

- name: Set up php8.4
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: 8.4
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
# Temporary workaround for missing pcntl_* in PHP 8.3
ini-values: disable_functions=
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Remove nextcloud/ocp
run: |
composer remove nextcloud/ocp --dev --no-scripts

- name: Install composer dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0

- name: Run coding standards check
run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github
13 changes: 13 additions & 0 deletions .github/workflows/psalm.yml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml
index d232cef..dc2507c 100644
--- a/.github/workflows/psalm.yml
+++ b/.github/workflows/psalm.yml
@@ -50,8 +50,5 @@ jobs:
- name: Install composer dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0

- - name: Install nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }}
- run: composer require --dev nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} --ignore-platform-reqs --with-dependencies
-
- name: Run coding standards check
run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github
167 changes: 167 additions & 0 deletions .github/workflows/sync-workflow-templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# 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: 2025 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

# This workflow will update all workflow templates
# Additionally it will reapply `workflow.yml.patch` files after syncing and only then commit the result
name: Update workflows
on:
workflow_dispatch:
schedule:
- cron: "45 22 * * 6"

permissions:
contents: read

jobs:
dispatch:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
branches:
- ${{ github.event.repository.default_branch }}
- 'stable35'
- 'stable34'
- 'stable33'

name: Update workflows in ${{ matrix.branches }}

permissions:
contents: write
pull-requests: write

steps:
- name: Check actor permission
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
with:
require: admin

- name: Checkout workflow repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
path: source
repository: nextcloud/.github

- name: Checkout app
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
path: target
ref: ${{ matrix.branches }}

- name: Check for active merge freeze
id: freeze
env:
BRANCH_NAME: ${{ matrix.branches }}
run: |
if [[ ! -f target/.github/workflows/block-merge-freeze.yml ]]; then
echo 'No block-merge-freeze workflow, continuing'
exit 0
fi
if [[ "$BRANCH_NAME" == 'main' || "$BRANCH_NAME" == 'master' ]]; then
SERVER_REF='master'
elif [[ "$BRANCH_NAME" =~ ^stable[0-9]+$ ]]; then
SERVER_REF="$BRANCH_NAME"
else
echo 'Not based on master/main/stable*, so skipping freeze check'
exit 0
fi
curl -sf "https://raw.githubusercontent.com/nextcloud/server/$SERVER_REF/version.php" --output version.php
if grep 'OC_VersionString' version.php | grep -q -i -E '(\.0\.0 RC[3-9]|\.[1-9][0-9]* RC)'; then
echo "Merge freeze is active for $SERVER_REF, skipping"
echo 'active=true' >> $GITHUB_OUTPUT
fi
rm version.php

- name: Copy all workflow templates
if: steps.freeze.outputs.active != 'true'
run: |
echo 'SUMMARY<<EOF' >> $GITHUB_ENV
draft_only=0
for workflow in ./source/workflow-templates/*.yml; do
echo "❓ Looking for $workflow"
if [ -f "$workflow" ]; then
filename=$(basename "$workflow")
target_file="./target/.github/workflows/$filename"

# Only copy if the file exists in the target repository
if [ -f "$target_file" ]; then
if [ -f "./target/.github/actions-lock.txt" ]; then
locked_version=$(grep " $filename" ./target/.github/actions-lock.txt | cat)
else
echo "# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors" >> ./target/.github/actions-lock.txt
echo "# SPDX-License""-Identifier: MIT" >> ./target/.github/actions-lock.txt
locked_version=""
fi
locked_version=$(echo $locked_version | cut -f 1 -d " ")
new_version=$(md5sum $workflow | cut -f 1 -d " ")

# Only update if the action changes
if [[ "$locked_version" != "$new_version" ]]; then
echo "ℹ️ Locked version: $locked_version"
echo "ℹ️ Current version: $new_version"
echo "🆙 Updating existing workflow: $filename"
echo "- 🆙 Updated [$filename](https://github.com/nextcloud/.github/commits/master/workflow-templates/$filename)" >> $GITHUB_ENV

cp "$workflow" "$target_file"

# Apply patch if one exists
if [ -f "$target_file.patch" ]; then
echo "🩹 Applying patch"
cd ./target
set +e
patch -p1 < ".github/workflows/$filename.patch"
patch_worked=$?
set -e
cd -
if [[ "$patch_worked" == "0" ]]; then
echo " - Patch applied" >> $GITHUB_ENV
else
echo " - [ ] ❌ Patch failed" >> $GITHUB_ENV
draft_only=1
fi
fi

if [[ "$locked_version" != "" ]]; then
sed -i "s/$locked_version $filename/$new_version $filename/" ./target/.github/actions-lock.txt
else
echo "$new_version $filename" >> ./target/.github/actions-lock.txt
fi
else
echo "✅ Skipping $filename: already up to date"
fi
else
echo "⏭️ Skipping $filename: does not exist in target repository"
fi
fi
done
echo 'EOF' >> $GITHUB_ENV
echo "DRAFT_ONLY=${draft_only}" >> $GITHUB_ENV

- name: Create Pull Request
if: steps.freeze.outputs.active != 'true'
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ secrets.COMMAND_BOT_WORKFLOWS }}
commit-message: 'ci(actions): Update workflow templates from organization template repository'
committer: GitHub <noreply@github.com>
author: nextcloud-command <nextcloud-command@users.noreply.github.com>
path: target
signoff: true
branch: 'automated/noid/${{ matrix.branches }}-update-workflows'
title: '[${{ matrix.branches }}] ci(actions): Update workflow templates from organization template repository'
draft: ${{ env.DRAFT_ONLY == 1 }}
add-paths: .github/workflows/*.yml,.github/actions-lock.txt
body: |
Automated update of all workflow templates from [nextcloud/.github](https://github.com/nextcloud/.github)
${{ env.SUMMARY }}
labels: |
dependencies
3. to review
5 changes: 3 additions & 2 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

$webinar = false;
if (get_post_type() == 'event') {
$cat = wp_get_object_terms(get_the_ID(), 'event_categories', []);
$cat = wp_get_object_terms((int)get_the_ID(), 'event_categories', []);
if ($cat) {
foreach ($cat as $c) {
if ($c->term_id == 250) { // event_categories Webinars
Expand Down Expand Up @@ -73,7 +73,8 @@
}

if (get_post_type() == 'event') {
$cat_id = get_queried_object()->term_id;
$queried_object = get_queried_object();
$cat_id = $queried_object instanceof WP_Term ? $queried_object->term_id : null;
}

?>
Expand Down
1 change: 0 additions & 1 deletion blocks/benefits3.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
$id = get_field('section_id');
$title = get_field('title');
$text = get_field('text');
$link = get_field('link');
?>
<section class="benefits3-section" id="<?php echo $id; ?>">
<div class="container">
Expand Down
Loading
Loading