ci: added licenses-php.yml

This commit is contained in:
Aleksandr Fedorov
2025-11-11 09:36:55 +03:00
parent 1189440dae
commit 837f89feea

36
.github/workflows/licenses-php.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: Licenses PHP
on:
workflow_dispatch:
push:
branches: [master, develop]
paths: ['web/documentserver-example/php/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/php/**']
jobs:
licences:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: cs2pr, phpcs
- name: Install Dependensies
run: composer install
working-directory: ./web/documentserver-example/php
- name: Get Repository License
id: license
run: |
license="${{ (github.event.repository.license.spdx_id) || (github.event.repository.licenses[0]) }}"
echo "License detected: $license"
echo "license=$license" >> $GITHUB_OUTPUT
- name: Check Licenses
uses: ONLYOFFICE/check-licenses@v1
with:
project_license: ${{ steps.license.outputs.license }}
working_directory: ./web/documentserver-example/php