Publish MCP Bundle + address upstream PR #172 feedback #13
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: Code Quality | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| # Install uv | |
| - name: Install uv | |
| run: pip install uv | |
| - name: Setup venv | |
| run: | | |
| python -m venv .venv | |
| - name: Install dependencies | |
| run: | | |
| uv pip install --python .venv/bin/python -e ".[dev]" | |
| - name: Check code quality | |
| id: quality | |
| continue-on-error: true | |
| run: | | |
| echo "::group::Running make ci" | |
| ci_output=$(uv run make ci 2>&1) || ci_failed=true | |
| echo "$ci_output" | |
| echo "::endgroup::" | |
| echo "# Code Quality Report" > report.md | |
| echo "" >> report.md | |
| if [ "$ci_failed" = true ]; then | |
| echo "### ❌ quality gate (make ci) failed" >> report.md | |
| echo "\`\`\`" >> report.md | |
| echo "$ci_output" >> report.md | |
| echo "\`\`\`" >> report.md | |
| echo "ci_failed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "### ✅ make ci passed" >> report.md | |
| echo "ci_failed=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Post results | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const report = fs.readFileSync('report.md', 'utf8'); | |
| // Posting comments doesn't work if the PR is from another repository (fork) due to permissions. | |
| // This is crude solution but should work. | |
| try { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: report | |
| }); | |
| } | |
| catch (error) { | |
| console.error("Error posting comment:", error); | |
| } | |
| - name: Check results | |
| if: steps.quality.outputs.ci_failed == 'true' | |
| run: exit 1 |