Skip to content

Commit a2d58b5

Browse files
committed
ci: add security check workflow
1 parent ca5a6fb commit a2d58b5

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
3+
name: 🔐 Security analysis
4+
5+
on: # yamllint disable-line rule:truthy
6+
pull_request:
7+
push:
8+
9+
jobs:
10+
security-analysis:
11+
timeout-minutes: 4
12+
runs-on: ${{ matrix.os }}
13+
concurrency:
14+
cancel-in-progress: true
15+
group: security-analysis-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
os:
20+
- ubuntu-latest
21+
php-version:
22+
- '8.2'
23+
dependencies:
24+
- locked
25+
steps:
26+
- name: 📦 Check out the codebase
27+
uses: actions/[email protected]
28+
29+
- name: 🛠️ Setup PHP
30+
uses: shivammathur/[email protected]
31+
with:
32+
php-version: ${{ matrix.php-version }}
33+
extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo
34+
ini-values: error_reporting=E_ALL
35+
coverage: none
36+
37+
- name: 🛠️ Setup problem matchers
38+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
39+
40+
- name: 🤖 Validate composer.json and composer.lock
41+
run: composer validate --ansi --strict
42+
43+
- name: 🔍 Get composer cache directory
44+
uses: wayofdev/gh-actions/actions/composer/[email protected]
45+
46+
- name: ♻️ Restore cached dependencies installed with composer
47+
uses: actions/[email protected]
48+
with:
49+
path: ${{ env.COMPOSER_CACHE_DIR }}
50+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
51+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
52+
53+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies
54+
uses: wayofdev/gh-actions/actions/composer/[email protected]
55+
with:
56+
dependencies: ${{ matrix.dependencies }}
57+
58+
- name: 🐛 Check installed packages for security vulnerability advisories
59+
run: composer audit --ansi

0 commit comments

Comments
 (0)