Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check on headers #1033

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading