Repository navigation
Show workflow hand-offs under a chat answer in V2 (Phase 7b) #547
Workflow file for this run
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: Broken Access Control Check | |
| on: | |
| pull_request: | |
| branches: | |
| - Development | |
| - paullizer-react-v2-ui # Temporary: remove when paullizer-react-v2-ui merges into Development (#1571) | |
| paths: | |
| - 'application/**/*.py' | |
| - 'scripts/check_broken_access_control.py' | |
| - 'functional_tests/test_broken_access_control_guardrails_checker.py' | |
| - '.github/workflows/broken-access-control-check.yml' | |
| - '.github/workflows/broken-access-control-full-scan.yml' | |
| - '.github/instructions/broken-access-control-prevention.instructions.md' | |
| - '.github/prompts/broken-access-control-audit.prompt.md' | |
| - '.github/prompts/route-authentication-audit.prompt.md' | |
| jobs: | |
| broken-access-control-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: '3.12' | |
| - name: Get changed Python files | |
| id: changed-files | |
| uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 | |
| with: | |
| files_yaml: | | |
| bac_surface: | |
| - 'application/**/*.py' | |
| bac_guardrails: | |
| - 'scripts/check_broken_access_control.py' | |
| - 'functional_tests/test_broken_access_control_guardrails_checker.py' | |
| - '.github/workflows/broken-access-control-check.yml' | |
| - '.github/workflows/broken-access-control-full-scan.yml' | |
| - '.github/instructions/broken-access-control-prevention.instructions.md' | |
| - '.github/prompts/broken-access-control-audit.prompt.md' | |
| - '.github/prompts/route-authentication-audit.prompt.md' | |
| - 'docs/explanation/features/v0.241.022/BROKEN_ACCESS_CONTROL_PR_GUARDRAILS.md' | |
| - name: Run Broken Access Control validation | |
| env: | |
| CHANGED_BAC_FILES: ${{ steps.changed-files.outputs.bac_surface_all_changed_files }} | |
| GITHUB_BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
| GITHUB_HEAD_SHA: ${{ github.sha }} | |
| run: | | |
| if [[ -z "$CHANGED_BAC_FILES" ]]; then | |
| echo "No changed application files detected for Broken Access Control validation." | |
| exit 0 | |
| fi | |
| echo "Changed application files:" | |
| printf '%s\n' "$CHANGED_BAC_FILES" | tr ' ' '\n' | |
| python scripts/check_broken_access_control.py \ | |
| --base-sha "$GITHUB_BASE_SHA" \ | |
| --head-sha "$GITHUB_HEAD_SHA" \ | |
| $CHANGED_BAC_FILES | |
| - name: Run Broken Access Control guardrail self-test (advisory) | |
| if: steps.changed-files.outputs.bac_guardrails_any_changed == 'true' | |
| continue-on-error: true | |
| run: | | |
| python functional_tests/test_broken_access_control_guardrails_checker.py |