Skip to content

Commit d126744

Browse files
authored
Merge pull request #3579 from mohitsaxenaknoldus/issue3428
[Testing] Provide a CI check for disallowed code changes
2 parents 525037e + 5d56f24 commit d126744

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/main.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ jobs:
157157
if: always()
158158

159159
needs:
160+
- check-changed-folders
160161
- integration-test
161162
- test
162163
- collateral
@@ -228,6 +229,38 @@ jobs:
228229
VM-${{ matrix.platform }},
229230
Py-${{ steps.python-install.outputs.python-version }}
230231
token: ${{ secrets.CODECOV_TOKEN }}
232+
233+
check-changed-folders:
234+
name: Fail the job if files changed under _disutils/_vendor folders
235+
if: github.event_name == 'pull_request'
236+
runs-on: ubuntu-latest
237+
steps:
238+
- name: Checkout code
239+
uses: actions/checkout@v3
240+
with:
241+
fetch-depth: 0
242+
- name: Check if files changed in the _distutils folder
243+
id: changed-files-specific-distutils
244+
uses: tj-actions/changed-files@v34
245+
with:
246+
files: |
247+
setuptools/_distutils/**
248+
- name: Check if files changed in the _vendor folder
249+
id: changed-files-specific-vendor
250+
uses: tj-actions/changed-files@v34
251+
with:
252+
files: |
253+
setuptools/_vendor/**
254+
- name: Fail the job if any file(s) in the _distutils folder change
255+
if: steps.changed-files-specific-distutils.outputs.any_changed == 'true'
256+
run: |
257+
echo "One or more files in the setuptools/_distutils folder has changed." | tee "${GITHUB_STEP_SUMMARY}"
258+
exit 1
259+
- name: Fail the job if any file(s) in the _vendor folder change
260+
if: steps.changed-files-specific-vendor.outputs.any_changed == 'true'
261+
run: |
262+
echo "One or more files in the setuptools/_vendor folder has changed." | tee "${GITHUB_STEP_SUMMARY}"
263+
exit 1
231264
232265
integration-test:
233266
needs: test

0 commit comments

Comments
 (0)