From 7ec689e2a7a52bfb3cdd6ffc608d1ac8213bffc4 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 10 Jun 2025 16:04:54 +0200 Subject: [PATCH] Update GH Actions --- .gitattributes | 3 +- .github/FUNDING.yml | 2 ++ .../workflows/create-release-attachment.yml | 12 ++++--- .github/workflows/{checks.yml => tests.yml} | 31 +++++++++++++++++-- README.md | 2 ++ 5 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 .github/FUNDING.yml rename .github/workflows/{checks.yml => tests.yml} (66%) diff --git a/.gitattributes b/.gitattributes index 449c446..fb6bdaf 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,2 @@ /.* export-ignore -/MAINTAINERS.md export-ignore -/README.md export-ignore +/*.md export-ignore diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..17aef88 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: mlocati +custom: https://paypal.me/mlocati diff --git a/.github/workflows/create-release-attachment.yml b/.github/workflows/create-release-attachment.yml index b2ceeae..2a1e9cf 100644 --- a/.github/workflows/create-release-attachment.yml +++ b/.github/workflows/create-release-attachment.yml @@ -9,20 +9,24 @@ jobs: attach-zip: name: Attach ZIP to release runs-on: ubuntu-latest + permissions: + contents: write steps: - - name: Setup PHP + - + name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '8.4' tools: composer:v2.2 coverage: none - - name: Checkout + - + name: Checkout uses: actions/checkout@v4 - - name: Create and attach ZIP + - + name: Create and attach ZIP uses: concrete5-community/gh-package-release-attach@main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: remove-files: | composer.json - composer.lock diff --git a/.github/workflows/checks.yml b/.github/workflows/tests.yml similarity index 66% rename from .github/workflows/checks.yml rename to .github/workflows/tests.yml index 94f3824..ec4b97e 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Checks +name: Tests on: push: @@ -12,7 +12,7 @@ on: jobs: - check-syntax: + check-php-syntax: name: PHP ${{ matrix.php-version }} Syntax runs-on: ubuntu-latest strategy: @@ -38,17 +38,44 @@ jobs: with: fail-on-warnings: true + check-development-leftovers: + name: Check Development Leftovers + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Search for debugger or xdebug_break + run: | + echo "Scanning for 'debugger' or 'xdebug_break'..." + matches=$(grep -Enr --include=\*.{js,php} '(^|[^a-zA-Z0-9_])(debugger|xdebug_break)\b' . || true) + if [[ -n "$matches" ]]; then + echo "Found the following matches:" + echo "$matches" + echo "::error::Development leftovers found in the codebase." + exit 1 + else + echo "No development leftovers found." + fi + check-install: name: Install on Concrete ${{ matrix.ccm-version }} runs-on: ubuntu-latest container: ghcr.io/concrete5-community/docker5:${{ matrix.ccm-version }} + needs: + - check-php-syntax + - check-development-leftovers strategy: matrix: ccm-version: - 8.5.12 + - "8.5" - "9.0" - "9.1" - "9.2" + - "9.3" + - "9.4" - latest steps: - diff --git a/README.md b/README.md index 2cc646a..39cab1e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Tests](https://github.com/concrete5-community/redirect_by_browser_lang/actions/workflows/tests.yml/badge.svg)](https://github.com/concrete5-community/redirect_by_browser_lang/actions/workflows/tests.yml) + # Redirect users by browser language This concrete5/ConcreteCMS package provides a page attribute that, if configured so, will redirect site visitors accordingly to their browser language.