From 039ee69683b4d2e97b1beb04b08121b69ff95a01 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 23 Aug 2024 17:20:01 +0200 Subject: [PATCH] filter changed files --- .github/workflows/CI_license_compliance.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI_license_compliance.yml b/.github/workflows/CI_license_compliance.yml index 96f7e7487..e7b6e4f39 100644 --- a/.github/workflows/CI_license_compliance.yml +++ b/.github/workflows/CI_license_compliance.yml @@ -28,10 +28,22 @@ jobs: with: python-version: "${{ env.PYTHON_VERSION }}" - - name: Get direct dependencies + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v45 + with: + files: | + integrations/**/pyproject.toml + + - name: Get direct dependencies from changed pyproject.toml files + if: ${{ steps['changed-files'].outputs.any_changed == 'true' }} run: | pip install toml - python .github/utils/pyproject_to_requirements.py pyproject.toml > ${{ env.REQUIREMENTS_FILE }} + > ${{ env.REQUIREMENTS_FILE }} # Empty the requirements file if it exists + for file in ${{ steps['changed-files'].outputs.all_changed_files }}; do + python .github/utils/pyproject_to_requirements.py $file >> ${{ env.REQUIREMENTS_FILE }} + echo "" >> ${{ env.REQUIREMENTS_FILE }} # Add a newline for separation + done - name: Check Licenses id: license_check_report