ci(deps): bump actions/setup-python from 5 to 6 in /.github/workflows #30
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: Pull Request | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| env: | |
| PYTHON_VERSION: '3.11' | |
| jobs: | |
| validate: | |
| name: Validate PR | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check PR title follows conventional commits | |
| # Skip semantic-pr check for Dependabot PRs (uses lowercase "bump..." subjects). | |
| if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' | |
| uses: amannn/action-semantic-pull-request@v5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| types: | | |
| feat | |
| fix | |
| docs | |
| style | |
| refactor | |
| perf | |
| test | |
| build | |
| ci | |
| chore | |
| revert | |
| requireScope: false | |
| # Allow any non-empty subject (case-insensitive). Dependabot uses lowercase. | |
| subjectPattern: ^.+$ | |
| subjectPatternError: | | |
| Subject must not be empty | |
| - name: Check for sensitive files | |
| run: | | |
| git diff --name-only origin/${{ github.base_ref }}...HEAD | while read file; do | |
| if [[ "$file" =~ \.env$|\.pem$|\.key$|credentials|secrets ]]; then | |
| echo "Potential sensitive file in PR: $file" | |
| fi | |
| done | |
| lint: | |
| name: Lint Python | |
| runs-on: ubuntu-latest | |
| needs: [validate] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install linters | |
| run: pip install ruff black mypy | |
| - name: Run Ruff | |
| run: ruff check octalume tests --output-format=github | |
| - name: Check formatting | |
| run: black --check octalume tests | |
| - name: Type check | |
| run: mypy octalume --ignore-missing-imports | |
| continue-on-error: true | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| needs: [validate] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Run tests | |
| run: pytest tests/ -v --tb=short | |
| size-label: | |
| name: Add Size Label | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: pascalgn/size-label-action@v0.5.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| sizes: > | |
| { | |
| "0": "size/XS", | |
| "10": "size/S", | |
| "50": "size/M", | |
| "200": "size/L", | |
| "500": "size/XL", | |
| "1000": "size/XXL" | |
| } | |
| security: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| needs: [validate] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install security tools | |
| run: pip install bandit pip-audit | |
| - name: Run Bandit | |
| run: bandit -r octalume -ll | |
| continue-on-error: true | |
| - name: Audit dependencies | |
| run: pip-audit | |
| continue-on-error: true | |
| welcome: | |
| name: Welcome Contributor | |
| runs-on: ubuntu-latest | |
| if: github.event.action == 'opened' | |
| steps: | |
| - uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| const { owner, repo } = context.repo; | |
| const prNumber = context.issue.number; | |
| const author = context.payload.pull_request.user.login; | |
| const { data: prs } = await github.rest.pulls.list({ | |
| owner, | |
| repo, | |
| state: 'all', | |
| creator: author | |
| }); | |
| if (prs.length === 1) { | |
| await github.rest.issues.createComment({ | |
| owner, | |
| repo, | |
| issue_number: prNumber, | |
| body: `## Welcome @${author}!\n\nThank you for your first contribution to OCTALUME!\n\nPlease make sure to:\n- Follow the [Contributing Guidelines](../blob/main/CONTRIBUTING.md)\n- Add tests for new features\n- Update documentation as needed\n- Run \`ruff check\` and \`black\` before committing\n\nOur team will review your PR soon.` | |
| }); | |
| } |