diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index c43add6..193c326 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -5,40 +5,58 @@ name: 🔐 Security analysis on: # yamllint disable-line rule:truthy pull_request: push: - branches: - - 1.x + branches: [1.x] + +# `head_ref` is the PR source branch on `pull_request` events and empty on `push` +# (falls back to `github.ref` = `refs/heads/`). Different PRs from different +# branches → different groups, so they never cross-cancel. Same PR pushed again +# → same group, the new run cancels the previous one. +# +# `cancel-in-progress` is only enabled on PR events: pushes to the default branch +# (1.x) keep their full history of CI runs. +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: contents: read jobs: security-analysis: - name: Composer audit timeout-minutes: 4 - runs-on: ubuntu-latest - concurrency: - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - group: security-analysis-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: + - ubuntu-latest + php-version: + - "8.5" + dependencies: + - highest steps: - name: 📦 Check out the codebase - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: persist-credentials: false - name: 🛠️ Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.5' + php-version: ${{ matrix.php-version }} ini-values: error_reporting=E_ALL coverage: none + - name: 🛠️ Setup problem matchers + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + - name: 🤖 Validate composer.json run: composer validate --ansi --strict - name: 📥 Install dependencies with composer - uses: ramsey/composer-install@v3 + uses: ramsey/composer-install@v4 with: - dependency-versions: highest + dependency-versions: ${{ matrix.dependencies }} - name: 🐛 Check installed packages for security vulnerability advisories run: composer audit --ansi