Skip to content

Commit 9095939

Browse files
[Maintenance] Make known upstream vulnerabilities not fail the pipe
1 parent 8f3eae2 commit 9095939

File tree

2 files changed

+72
-28
lines changed

2 files changed

+72
-28
lines changed

.github/workflows/build.yaml

Lines changed: 66 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
matrix:
2222
php: ["8.3"]
2323
symfony: ["^5.4.21", "^6.4"]
24-
sylius: ["~1.13.0", "~1.14.0"]
24+
sylius: ["~1.14.0"]
2525
database: ["mysql", "postgres"]
2626
mysql: ["8.4"]
2727
postgres: ["15.8"]
@@ -30,7 +30,7 @@ jobs:
3030

3131
include:
3232
-
33-
php: "8.1"
33+
php: "8.3"
3434
symfony: "^6.4"
3535
sylius: "~1.14.0"
3636
database: "mysql"
@@ -39,7 +39,7 @@ jobs:
3939
wkhtmltopdf: "0.12.6-1"
4040
state_machine_adapter: "symfony_workflow"
4141
-
42-
php: "8.2"
42+
php: "8.3"
4343
symfony: "^6.4"
4444
sylius: "~1.14.0"
4545
database: "mysql"
@@ -48,7 +48,7 @@ jobs:
4848
wkhtmltopdf: "0.12.6-1"
4949
state_machine_adapter: "winzou_state_machine"
5050
-
51-
php: "8.2"
51+
php: "8.3"
5252
symfony: "^6.4"
5353
sylius: "~1.14.0"
5454
database: "mysql"
@@ -143,6 +143,68 @@ jobs:
143143
name: Install PHP dependencies
144144
run: composer install --no-interaction
145145

146+
- name: Run security checks
147+
run: |
148+
set -e
149+
150+
composer audit --no-interaction --format=json > composer-audit.json || AUDIT_EXIT=$?
151+
152+
IGNORED=$(jq -r '.config.audit.ignore[]?' composer.json | sort || true)
153+
154+
if [ "${AUDIT_EXIT:-0}" -ne 0 ]; then
155+
FOUND=$(jq -r '
156+
# Collect CVEs from both advisories and ignored-advisories
157+
(.advisories[]?.advisories[]?.cve? // empty),
158+
(.["ignored-advisories"][]?[]?.cve? // empty)
159+
' composer-audit.json | sort | uniq)
160+
161+
DIFF=$(comm -23 <(echo "$FOUND") <(echo "$IGNORED"))
162+
163+
if [ -n "$DIFF" ]; then
164+
echo "❌ New vulnerabilities found by Composer audit:"
165+
echo "$DIFF"
166+
exit 1
167+
else
168+
echo "✅ No new vulnerabilities found by Composer audit."
169+
fi
170+
else
171+
echo "✅ No new vulnerabilities found by Composer audit."
172+
fi
173+
174+
symfony security:check --format=json > symfony-audit.json || true
175+
176+
FOUND=$(jq -r '.[]?.advisories[]?.cve? // empty' symfony-audit.json | sort | uniq)
177+
178+
DIFF=$(comm -23 <(echo "$FOUND") <(echo "$IGNORED"))
179+
180+
if [ -n "$DIFF" ]; then
181+
echo "❌ New vulnerabilities found by Symfony security:check:"
182+
echo "$DIFF"
183+
exit 1
184+
else
185+
echo "✅ No new vulnerabilities found by Symfony security:check."
186+
fi
187+
188+
-
189+
name: Run ECS
190+
run: vendor/bin/ecs check
191+
192+
-
193+
name: Validate composer.json
194+
run: composer validate --ansi --strict
195+
196+
-
197+
name: Run analysis
198+
run: composer analyse
199+
200+
-
201+
name: Run PHPStan
202+
run: vendor/bin/phpstan analyse -c phpstan.neon.dist src/
203+
204+
-
205+
name: Run PHPSpec
206+
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
207+
146208
-
147209
name: Get Yarn cache directory
148210
id: yarn-cache
@@ -192,30 +254,6 @@ jobs:
192254
name: Load fixtures in test application
193255
run: (cd tests/Application && bin/console sylius:fixtures:load -n)
194256

195-
-
196-
name: Run security check
197-
run: symfony security:check
198-
199-
-
200-
name: Run ECS
201-
run: vendor/bin/ecs check
202-
203-
-
204-
name: Validate composer.json
205-
run: composer validate --ansi --strict
206-
207-
-
208-
name: Run analysis
209-
run: composer analyse
210-
211-
-
212-
name: Run PHPStan
213-
run: vendor/bin/phpstan analyse -c phpstan.neon.dist src/
214-
215-
-
216-
name: Run PHPSpec
217-
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
218-
219257
-
220258
name: Run PHPUnit
221259
run: vendor/bin/phpunit --colors=always

composer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@
6464
"symfony/flex": true,
6565
"symfony/thanks": false,
6666
"php-http/discovery": true
67+
},
68+
"audit": {
69+
"ignore": [
70+
"CVE-2025-31481",
71+
"CVE-2025-31485"
72+
]
6773
}
6874
},
6975
"conflict": {

0 commit comments

Comments
 (0)