ci: added licenses-python.yml

This commit is contained in:
Aleksandr Fedorov
2025-11-14 16:34:35 +03:00
parent 6bf436c506
commit 2728a61653
2 changed files with 104 additions and 0 deletions

55
.github/workflows/licenses-python.yml vendored Normal file
View File

@ -0,0 +1,55 @@
name: Licenses Python
on:
workflow_dispatch:
push:
branches: [master, develop]
paths: ['web/documentserver-example/python/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/python/**']
jobs:
licences:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install PIP
run: |
python -m pip install --upgrade pip==20.3.4
pip install tomli
working-directory: ./web/documentserver-example/python
- name: Generate requirements.txt from pyproject.toml
run: |
python - <<'EOF'
import tomli
with open('pyproject.toml', 'rb') as f:
d = tomli.load(f)
deps = d.get('project', {}).get('dependencies', [])
dev = d.get('project', {}).get('optional-dependencies', {}).get('development', [])
with open('requirements.txt', 'w') as out:
out.write('\n'.join(deps + dev))
print('Generated requirements.txt:')
print('\n'.join(deps + dev))
EOF
working-directory: ./web/documentserver-example/python
- name: Install Dependencies
run: |
pip install -r requirements.txt
working-directory: ./web/documentserver-example/python
- 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/python

View File

@ -0,0 +1,49 @@
---
- - :approve
- django-stubs
- :who:
:why: MIT
:versions: []
:when: 2025-11-07 10:06:50.553792100 Z
- - :approve
- django-stubs-ext
- :who:
:why: MIT
:versions: []
:when: 2025-11-07 10:07:45.678886500 Z
- - :approve
- idna
- :who:
:why: BSD-3-Clause
:versions: []
:when: 2025-11-07 10:08:31.344047300 Z
- - :approve
- mypy-extensions
- :who:
:why: MIT
:versions: []
:when: 2025-11-07 10:09:26.564110500 Z
- - :approve
- types-pyyaml
- :who:
:why: Apache-2.0
:versions: []
:when: 2025-11-07 10:10:57.504396600 Z
- - :approve
- types-requests
- :who:
:why: Apache-2.0
:versions: []
:when: 2025-11-07 10:12:16.024338500 Z
- - :approve
- typing-extensions
- :who:
:why: PSF-2.0
:versions: []
:when: 2025-11-07 10:13:27.961443200 Z
- - :approve
- urllib3
- :who:
:why: MIT
:versions: []
:when: 2025-11-07 10:13:51.477550000 Z