-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,60 @@ | ||
name: Security | ||
name: 🔐 Security analysis | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'bin/**' | ||
- 'resources/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- '.editorconfig' | ||
- 'psalm.xml' | ||
|
||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'bin/**' | ||
- 'resources/**' | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- '.gitignore' | ||
- '.gitattributes' | ||
- '.editorconfig' | ||
- 'psalm.xml' | ||
|
||
jobs: | ||
security: | ||
name: Security Checks (PHP ${{ matrix.php }}, OS ${{ matrix.os }}) | ||
security-analysis: | ||
timeout-minutes: 4 | ||
runs-on: ${{ matrix.os }} | ||
concurrency: | ||
cancel-in-progress: true | ||
group: security-analysis-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
strategy: | ||
fail-fast: false | ||
fail-fast: true | ||
matrix: | ||
# Note: This workflow requires only the LATEST version of PHP | ||
php: [ 8.2 ] | ||
os: [ ubuntu-latest ] | ||
os: | ||
- ubuntu-latest | ||
php-version: | ||
- '8.2' | ||
dependencies: | ||
- locked | ||
steps: | ||
- name: Set up PHP ${{ matrix.php }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: dom, sockets, grpc, curl | ||
- name: 📦 Check out the codebase | ||
uses: actions/[email protected] | ||
|
||
- name: Check Out Code | ||
uses: actions/checkout@v4 | ||
- name: 🛠️ Setup PHP | ||
uses: shivammathur/[email protected] | ||
with: | ||
fetch-depth: 1 | ||
php-version: ${{ matrix.php-version }} | ||
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, sockets | ||
ini-values: error_reporting=E_ALL | ||
coverage: none | ||
|
||
- name: 🛠️ Setup problem matchers | ||
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: 🤖 Validate composer.json and composer.lock | ||
run: composer validate --ansi --strict | ||
|
||
- name: Cache Dependencies | ||
uses: actions/cache@v3 | ||
- name: 🔍 Get composer cache directory | ||
uses: wayofdev/gh-actions/actions/composer/[email protected] | ||
|
||
- name: ♻️ Restore cached dependencies installed with composer | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: php-${{ matrix.php }}-${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: php-${{ matrix.php }}-${{ runner.os }}-composer- | ||
path: ${{ env.COMPOSER_CACHE_DIR }} | ||
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }} | ||
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- | ||
|
||
- name: Install Composer Dependencies | ||
run: composer install --prefer-dist --no-interaction | ||
- name: 📥 Install "${{ matrix.dependencies }}" dependencies | ||
uses: wayofdev/gh-actions/actions/composer/[email protected] | ||
with: | ||
dependencies: ${{ matrix.dependencies }} | ||
|
||
- name: Verify | ||
- name: 🐛 Check installed packages using roave/security-advisories | ||
run: composer require --dev roave/security-advisories:dev-latest | ||
|
||
- name: 🐛 Check installed packages for security vulnerability advisories | ||
run: composer audit --ansi |