diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 52f11528ae..c6078bcd10 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -157,6 +157,7 @@ jobs: if: always() needs: + - check-changed-folders - integration-test - test - collateral @@ -228,6 +229,38 @@ jobs: VM-${{ matrix.platform }}, Py-${{ steps.python-install.outputs.python-version }} token: ${{ secrets.CODECOV_TOKEN }} + + check-changed-folders: + name: Fail the job if files changed under _disutils/_vendor folders + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Check if files changed in the _distutils folder + id: changed-files-specific-distutils + uses: tj-actions/changed-files@v34 + with: + files: | + setuptools/_distutils/** + - name: Check if files changed in the _vendor folder + id: changed-files-specific-vendor + uses: tj-actions/changed-files@v34 + with: + files: | + setuptools/_vendor/** + - name: Fail the job if any file(s) in the _distutils folder change + if: steps.changed-files-specific-distutils.outputs.any_changed == 'true' + run: | + echo "One or more files in the setuptools/_distutils folder has changed." | tee "${GITHUB_STEP_SUMMARY}" + exit 1 + - name: Fail the job if any file(s) in the _vendor folder change + if: steps.changed-files-specific-vendor.outputs.any_changed == 'true' + run: | + echo "One or more files in the setuptools/_vendor folder has changed." | tee "${GITHUB_STEP_SUMMARY}" + exit 1 integration-test: needs: test