Skip to content
Open
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
14 changes: 11 additions & 3 deletions .github/workflows/blackbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: BlackBox Tests

on: [ push, pull_request ]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -10,17 +13,22 @@ jobs:

name: Run BlackBox Tests
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@8492260343ad570701412c2f464a5877dc76bace # v2
with:
path: ~/.composer/cache/files
key: dependencies-blackbox

- name: Setup PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2
with:
php-version: 8.3
coverage: none
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,31 @@ name: Code Checks

on: [ push, pull_request ]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

name: Code Checks
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@8492260343ad570701412c2f464a5877dc76bace # v2
with:
path: ~/.composer/cache/files
key: dependencies-code-checks

- name: Setup PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2
with:
php-version: 8.3
coverage: none
Expand All @@ -39,17 +47,22 @@ jobs:
- "8.3"
name: PHPStan on PHP ${{ matrix.php }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@8492260343ad570701412c2f464a5877dc76bace # v2
with:
path: ~/.composer/cache/files
key: dependencies-code-checks

- name: Setup PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2
with:
php-version: ${{ matrix.php }}
coverage: none
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,22 @@ jobs:
DB_PASSWORD: root

steps:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing Permissions Block in Workflow

The tests.yml workflow is missing the permissions: contents: read block, unlike blackbox.yml and checks.yml. This means tests.yml retains broader default GitHub token permissions, which goes against the PR's goal of applying least privilege and creates a security gap.

Fix in Cursor Fix in Web

- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@8492260343ad570701412c2f464a5877dc76bace # v2
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2
with:
php-version: ${{ matrix.php }}
extensions: redis, apcu
Expand All @@ -47,7 +52,7 @@ jobs:
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest

- name: Start Redis
uses: supercharge/[email protected]
uses: supercharge/redis-github-action@8dd3c86cd02fabe1bc459d55ba892a9ce91e23c6 # 1.1.0
with:
redis-version: ${{ matrix.redis-version }}

Expand Down