Skip to content

Commit

Permalink
Add check on headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Quetzacoalt91 committed Nov 25, 2024
1 parent 4be38a1 commit c694921
Show file tree
Hide file tree
Showing 3 changed files with 194 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,24 @@ jobs:
for file in autoupgrade.php controllers/admin/AdminSelfUpgradeController.php classes/VersionUtils.php classes/UpgradeTools/Translator.php; do
php -l $file;
done
header-stamp:
name: Check license headers
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP 8.3
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'

- run: composer install

- name: Run Header Stamp in Dry Run mode
run: |
php tests/vendor/bin/header-stamp --license=tests/vendor/prestashop/header-stamp/assets/afl.txt --exclude=vendor,tests,_dev --dry-run || {
echo "::error::Some headers are missing or incorrect. Run 'tests/vendor/bin/header-stamp --license=tests/vendor/prestashop/header-stamp/assets/afl.txt --exclude=vendor,tests,_dev' to autofix them."
exit 1
}
3 changes: 2 additions & 1 deletion tests/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"require-dev": {
"phpstan/phpstan": "^1.11",
"prestashop/php-dev-tools": "^5"
"prestashop/php-dev-tools": "^5",
"prestashop/header-stamp": "^2.3"
},
"config": {
"platform": {
Expand Down
172 changes: 171 additions & 1 deletion tests/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c694921

Please sign in to comment.