Fork test: PR #1303 - Guard check filter and row_filter against unsafe SQL #5277
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: no-cheat | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| merge_group: | |
| types: [checks_requested] | |
| push: | |
| # required for merge queue to work. jobs.integration.if will mark it as skipped | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| no-pylint-disable: | |
| runs-on: | |
| group: databrickslabs-protected-runner-group | |
| labels: linux-ubuntu-latest | |
| if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Verify no lint is disabled in the new code | |
| run: | | |
| NEW_CODE=$(git diff origin/main..$(git branch --show-current) -- '*.py' | awk '/^\+/') | |
| CHEAT=$(echo "${NEW_CODE}" | grep '# pylint: disable' | grep -v "CHEAT" | wc -c) | |
| if [ "${CHEAT}" -ne 0 ]; then | |
| echo "Do not cheat the linter: ${CHEAT}" | |
| exit 1 | |
| fi |