chore: add token rotate quality gates #1
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: quality | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| token-rotate-quality: | |
| name: token-rotate quality gates | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Syntax check | |
| run: python -m py_compile token-rotate/gitlab_project_token_rotator.py token-rotate/test_gitlab_project_token_rotator.py token-rotate/quality_gate.py | |
| - name: Install coverage quality tool | |
| run: python -m pip install --upgrade coverage | |
| - name: Unit tests and coverage gate | |
| run: python token-rotate/quality_gate.py --min-coverage 80 | |
| semgrep: | |
| name: semgrep security scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Semgrep | |
| run: python -m pip install --upgrade semgrep | |
| - name: Run Semgrep | |
| run: semgrep scan --config .semgrep.yml --config p/python --error |