Skip to content

Commit 444fc29

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.8
2 parents 427fac0 + 5f0e093 commit 444fc29

16 files changed

+74
-82
lines changed

.github/workflows/deploy-userguide-latest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
6060
# Create an artifact of the html output
6161
- name: Upload artifact
62-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
62+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
6363
with:
6464
name: HTML Documentation
6565
path: user_guide_src/build/html/

.github/workflows/label-pr.yml

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,7 @@ on:
77
- pull_request_target
88

99
jobs:
10-
validate-source:
11-
permissions:
12-
contents: read
13-
pull-requests: read
14-
runs-on: ubuntu-24.04
15-
outputs:
16-
valid: ${{ steps.check.outputs.valid }}
17-
18-
steps:
19-
- name: Check if PR is from the main repository
20-
id: check
21-
run: |
22-
if [[ "$HEAD_REPO" == "codeigniter4/CodeIgniter4" ]]; then
23-
echo "valid=true" >> $GITHUB_OUTPUT
24-
else
25-
echo "valid=false" >> $GITHUB_OUTPUT
26-
fi
27-
env:
28-
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
29-
3010
add-labels:
31-
needs: validate-source
3211
permissions:
3312
contents: read
3413
pull-requests: write
@@ -41,20 +20,26 @@ jobs:
4120
persist-credentials: false
4221

4322
- name: Verify PR source for workflow file changes
44-
run: |
45-
# Get changed files in this PR
46-
git fetch origin "refs/pull/${{ github.event.pull_request.number }}/merge"
47-
CHANGED_FILES=$(git diff --name-only origin/develop FETCH_HEAD 2>/dev/null || echo "")
48-
49-
# Check if this workflow file is being modified
50-
if echo "$CHANGED_FILES" | grep -q "\.github/workflows/label-pr\.yml"; then
51-
if [[ "$IS_VALID" != "true" ]]; then
52-
echo "::error::Changes to label-pr.yml can only be made from the main repository."
53-
exit 1
54-
fi
55-
fi
56-
env:
57-
IS_VALID: ${{ needs.validate-source.outputs.valid }}
23+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
24+
with:
25+
script: |
26+
const prFiles = await github.paginate(github.rest.pulls.listFiles.endpoint.merge({
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
pull_number: context.payload.pull_request.number,
30+
}));
31+
const workflowFileChanged = prFiles.some(file => file.filename === '.github/workflows/label-pr.yml');
32+
33+
if (workflowFileChanged) {
34+
if (context.payload.pull_request.head.repo.full_name !== 'codeigniter4/CodeIgniter4') {
35+
throw new Error('Changes to label-pr.yml are not allowed from forks.');
36+
}
37+
38+
console.log('Workflow file changed, but PR is from the main repository. Proceeding with label addition.');
39+
return;
40+
}
41+
42+
console.log('No changes to workflow file detected, proceeding with label addition.');
5843
5944
- name: Add labels
6045
uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1

.github/workflows/reusable-coveralls.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
5151
5252
- name: Cache dependencies
53-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
53+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
5454
with:
5555
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
5656
key: ${{ github.job }}-php-${{ inputs.php-version }}-${{ hashFiles('**/composer.*') }}
@@ -59,7 +59,7 @@ jobs:
5959
${{ github.job }}-
6060
6161
- name: Cache PHPUnit's static analysis cache
62-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
62+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
6363
with:
6464
path: build/.phpunit.cache/code-coverage
6565
key: phpunit-code-coverage-${{ hashFiles('**/phpunit.*') }}

.github/workflows/reusable-phpunit-test.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
# Service containers cannot be extracted to caller workflows yet
7474
services:
7575
mysql:
76-
image: mysql:${{ inputs.mysql-version || '8.0' }}
76+
image: ${{ inputs.db-platform == 'MySQLi' && format('mysql:{0}', inputs.mysql-version || '8.0') || '' }}
7777
env:
7878
MYSQL_ALLOW_EMPTY_PASSWORD: yes
7979
MYSQL_DATABASE: test
@@ -86,7 +86,7 @@ jobs:
8686
--health-retries=3
8787
8888
postgres:
89-
image: postgres
89+
image: ${{ inputs.db-platform == 'Postgre' && 'postgres' || '' }}
9090
env:
9191
POSTGRES_USER: postgres
9292
POSTGRES_PASSWORD: postgres
@@ -100,7 +100,7 @@ jobs:
100100
--health-retries=3
101101
102102
mssql:
103-
image: mcr.microsoft.com/mssql/server:2025-CU2-ubuntu-24.04
103+
image: ${{ inputs.db-platform == 'SQLSRV' && 'mcr.microsoft.com/mssql/server:2025-CU3-ubuntu-24.04' || '' }}
104104
env:
105105
MSSQL_SA_PASSWORD: 1Secure*Password1
106106
ACCEPT_EULA: Y
@@ -114,7 +114,7 @@ jobs:
114114
--health-retries=3
115115
116116
oracle:
117-
image: gvenzl/oracle-free:latest
117+
image: ${{ inputs.db-platform == 'OCI8' && 'gvenzl/oracle-free:latest' || '' }}
118118
env:
119119
ORACLE_RANDOM_PASSWORD: true
120120
APP_USER: ORACLE
@@ -146,10 +146,9 @@ jobs:
146146
- name: Install mssql-tools on runner
147147
if: ${{ inputs.db-platform == 'SQLSRV' }}
148148
run: |
149-
# Detect Ubuntu version used by the runner (fallback to 24.04)
150-
DISTRO=$(lsb_release -rs 2>/dev/null || echo '24.04')
151-
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
152-
curl -sSL https://packages.microsoft.com/config/ubuntu/${DISTRO}/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
149+
source /etc/os-release
150+
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor --batch --yes -o /usr/share/keyrings/microsoft-prod.gpg
151+
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/ubuntu/${VERSION_ID}/prod ${UBUNTU_CODENAME} main" | sudo tee /etc/apt/sources.list.d/mssql-release.list
153152
sudo apt-get update
154153
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 mssql-tools18 unixodbc-dev
155154
@@ -209,7 +208,7 @@ jobs:
209208
echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}${{ inputs.mysql-version || '' }}" >> $GITHUB_OUTPUT
210209
211210
- name: Cache dependencies
212-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
211+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
213212
with:
214213
path: ${{ steps.setup-env.outputs.COMPOSER_CACHE_FILES_DIR }}
215214
key: ${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-db-${{ inputs.db-platform || 'none' }}-${{ hashFiles('**/composer.*') }}
@@ -220,7 +219,7 @@ jobs:
220219
221220
- name: Cache PHPUnit's static analysis cache
222221
if: ${{ inputs.enable-artifact-upload }}
223-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
222+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
224223
with:
225224
path: build/.phpunit.cache/code-coverage
226225
key: phpunit-code-coverage-${{ hashFiles('**/phpunit.*') }}
@@ -250,7 +249,7 @@ jobs:
250249

251250
- name: Upload coverage results as artifact
252251
if: ${{ inputs.enable-artifact-upload }}
253-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
252+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
254253
with:
255254
name: ${{ steps.setup-env.outputs.ARTIFACT_NAME }}
256255
path: build/cov/coverage-${{ steps.setup-env.outputs.ARTIFACT_NAME }}.cov

.github/workflows/reusable-serviceless-phpunit-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
echo "ARTIFACT_NAME=${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}" >> $GITHUB_OUTPUT
9696
9797
- name: Cache Composer dependencies
98-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
98+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
9999
with:
100100
path: ${{ steps.setup-env.outputs.COMPOSER_CACHE_FILES_DIR }}
101101
key: ${{ inputs.job-id || github.job }}-php-${{ inputs.php-version }}-${{ hashFiles('**/composer.*') }}
@@ -105,7 +105,7 @@ jobs:
105105
106106
- name: Cache PHPUnit's static analysis cache
107107
if: ${{ inputs.enable-artifact-upload }}
108-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
108+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
109109
with:
110110
path: build/.phpunit.cache/code-coverage
111111
key: phpunit-code-coverage-${{ hashFiles('**/phpunit.*') }}
@@ -133,7 +133,7 @@ jobs:
133133

134134
- name: Upload coverage results as artifact
135135
if: ${{ inputs.enable-artifact-upload }}
136-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
136+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
137137
with:
138138
name: ${{ steps.setup-env.outputs.ARTIFACT_NAME }}
139139
path: build/cov/coverage-${{ steps.setup-env.outputs.ARTIFACT_NAME }}.cov

.github/workflows/test-coding-standards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
5656

5757
- name: Cache dependencies
58-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
58+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
5959
with:
6060
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
6161
key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}

.github/workflows/test-deptrac.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6161

6262
- name: Cache dependencies
63-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
63+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
6464
with:
6565
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
6666
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
@@ -70,7 +70,7 @@ jobs:
7070
run: mkdir -p build/
7171

7272
- name: Cache Deptrac results
73-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
73+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
7474
with:
7575
path: build
7676
key: ${{ runner.os }}-deptrac-${{ github.sha }}

.github/workflows/test-phpstan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
7373

7474
- name: Cache dependencies
75-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
75+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
7676
with:
7777
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
7878
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
@@ -82,7 +82,7 @@ jobs:
8282
run: mkdir -p build/phpstan
8383

8484
- name: Cache PHPStan result cache directory
85-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
85+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
8686
with:
8787
path: build/phpstan
8888
key: ${{ runner.os }}-phpstan-${{ github.sha }}

.github/workflows/test-psalm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6262

6363
- name: Cache composer dependencies
64-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
64+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
6565
with:
6666
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
6767
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
@@ -71,7 +71,7 @@ jobs:
7171
run: mkdir -p build/psalm
7272

7373
- name: Cache Psalm results
74-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
74+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
7575
with:
7676
path: build/psalm
7777
key: ${{ runner.os }}-psalm-${{ github.sha }}

.github/workflows/test-random-execution.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979

8080
services:
8181
mysql:
82-
image: mysql:8.0
82+
image: ${{ matrix.db-platform == 'MySQLi' && 'mysql:8.0' || '' }}
8383
env:
8484
MYSQL_ALLOW_EMPTY_PASSWORD: yes
8585
MYSQL_DATABASE: test
@@ -92,7 +92,7 @@ jobs:
9292
--health-retries=3
9393
9494
postgres:
95-
image: postgres
95+
image: ${{ matrix.db-platform == 'Postgre' && 'postgres' || '' }}
9696
env:
9797
POSTGRES_USER: postgres
9898
POSTGRES_PASSWORD: postgres
@@ -106,7 +106,7 @@ jobs:
106106
--health-retries=3
107107
108108
mssql:
109-
image: mcr.microsoft.com/mssql/server:2025-CU2-ubuntu-24.04
109+
image: ${{ matrix.db-platform == 'SQLSRV' && 'mcr.microsoft.com/mssql/server:2025-CU3-ubuntu-24.04' || '' }}
110110
env:
111111
MSSQL_SA_PASSWORD: 1Secure*Password1
112112
ACCEPT_EULA: Y
@@ -120,7 +120,7 @@ jobs:
120120
--health-retries=3
121121
122122
oracle:
123-
image: gvenzl/oracle-free:latest
123+
image: ${{ matrix.db-platform == 'Oracle' && 'gvenzl/oracle-free:latest' || '' }}
124124
env:
125125
ORACLE_RANDOM_PASSWORD: true
126126
APP_USER: ORACLE
@@ -182,7 +182,7 @@ jobs:
182182
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
183183

184184
- name: Cache composer dependencies
185-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
185+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
186186
with:
187187
path: ${{ steps.composer-cache.outputs.COMPOSER_CACHE_FILES_DIR }}
188188
key: PHP_${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}
@@ -226,7 +226,7 @@ jobs:
226226

227227
- name: Upload random-test artifacts on failure
228228
if: ${{ always() && failure() }}
229-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
229+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
230230
with:
231231
name: random-tests-${{ matrix.db-platform }}-php${{ matrix.php-version }}
232232
path: build/random-tests/

0 commit comments

Comments
 (0)