Skip to content

Commit

Permalink
Merge pull request #63 from asgoodasnu/feature/dev-593-composer-audit…
Browse files Browse the repository at this point in the history
…-implementation

DEV-593 - added composer audit workflow implementation
  • Loading branch information
StephanAltmann authored Feb 22, 2024
2 parents 3fa97b2 + 43ef2a5 commit da7d8ba
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/composerAudit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on: [push]
name: Composer Audit Check
jobs:
composer-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read the current used PHP Version
id: get-php-version
run: echo "::set-output name=version $(head -n1 .php-version)"
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ steps.get-php-version.outputs.version }}
tools: pecl, composer:2

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-scripts --no-dev

- run: composer audit
2 changes: 1 addition & 1 deletion src/AkeneoApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ public function getCategories(string $rootCode): CategoryItem;
/**
* @throws AkeneoApiException
*/
public function triggerUpdate(string $identifier, string $message = null): void;
public function triggerUpdate(string $identifier, ?string $message = null): void;
}
2 changes: 1 addition & 1 deletion src/AkeneoApiException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class AkeneoApiException extends \Exception
{
protected function __construct(string $message = '', \Throwable $previous = null)
protected function __construct(string $message = '', ?\Throwable $previous = null)
{
parent::__construct($message, 0, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/CachedSymfonyHttpClientAkeneoApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getCategories(string $rootCode): CategoryItem
return $item;
}

public function triggerUpdate(string $identifier, string $message = null): void
public function triggerUpdate(string $identifier, ?string $message = null): void
{
$this->decorated->triggerUpdate($identifier);
}
Expand Down
2 changes: 1 addition & 1 deletion src/SymfonyHttpClientAkeneoApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getCategories(string $rootCode): CategoryItem
/**
* @throws AkeneoApiException
*/
public function triggerUpdate(string $identifier, string $message = null): void
public function triggerUpdate(string $identifier, ?string $message = null): void
{
$this->assertProductExists($identifier);

Expand Down

0 comments on commit da7d8ba

Please sign in to comment.