-
Notifications
You must be signed in to change notification settings - Fork 10
ci: add PR-Agent review + Qodo merge + upstream issues watch #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: pr-agent-review | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
| issue_comment: | ||
| types: [created] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| issues: write | ||
|
|
||
| jobs: | ||
| pr_agent_job: | ||
| name: PR-Agent (DeepSeek) | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.event.sender.type != 'Bot' && secrets.DEEPSEEK_API_KEY != '' }} | ||
| steps: | ||
| - name: PR Agent review | ||
| uses: the-pr-agent/pr-agent@main | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This workflow runs a third-party action from the moving Useful? React with 👍 / 👎. |
||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} | ||
| config.model: "deepseek/deepseek-chat" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
DeepSeek currently marks Useful? React with 👍 / 👎. |
||
| config.fallback_models: '["deepseek/deepseek-chat"]' | ||
| pr_reviewer.require_score_review: "false" | ||
| pr_reviewer.num_code_suggestions: "4" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: qodo-merge | ||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
|
|
||
| jobs: | ||
| qodo-merge: | ||
| if: ${{ secrets.QODO_API_KEY != "" }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
GitHub Actions does not allow referencing the Useful? React with 👍 / 👎. |
||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| issues: write | ||
| pull-requests: write | ||
| contents: read | ||
| steps: | ||
| - name: Qodo Merge Review | ||
| uses: qodo-ai/qodo-merge@main | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this job reaches the review step, GitHub resolves Useful? React with 👍 / 👎. |
||
| env: | ||
| QODO_API_KEY: ${{ secrets.QODO_API_KEY }} | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: upstream-issues-watch | ||
|
|
||
| on: | ||
| schedule: | ||
| # Daily at 08:00 UTC | ||
| - cron: "0 8 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
| issues: read | ||
|
|
||
| jobs: | ||
| watch: | ||
| name: Fetch upstream issues | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| # Need history of UPSTREAM_ISSUES.md to know what's new | ||
| fetch-depth: 2 | ||
|
|
||
| - name: Fetch recent issues from upstream | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| # In fork context: fetch from the upstream owner/repo | ||
| UPSTREAM="lemonade-sdk/lemon-mlx-engine" | ||
| CACHE="UPSTREAM_ISSUES.md" | ||
| NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | ||
|
|
||
| # Get all open issues from upstream (API max 100 per page) | ||
| echo "# Upstream Issues — ${UPSTREAM}" > "${CACHE}.new" | ||
| echo "Last checked: ${NOW}" >> "${CACHE}.new" | ||
| echo "" >> "${CACHE}.new" | ||
|
|
||
| curl -s "https://api.github.com/repos/${UPSTREAM}/issues?state=open&per_page=50&sort=created&direction=desc" \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The PR describes this watcher as tracking upstream issues tagged Useful? React with 👍 / 👎. |
||
| | jq -r '.[] | select(.pull_request == null) | "- [#\(.number)](\(.html_url)) — \(.title) (\(.created_at))"' \ | ||
| >> "${CACHE}.new" 2>/dev/null || echo "_No issues found or API error_" >> "${CACHE}.new" | ||
|
|
||
| # Diff against what we had before | ||
| if [ -f "$CACHE" ]; then | ||
| OLD_COUNT=$(grep -c '^\- \[' "$CACHE" 2>/dev/null || echo 0) | ||
| NEW_COUNT=$(grep -c '^\- \[' "${CACHE}.new" 2>/dev/null || echo 0) | ||
| echo "Previous issue count: ${OLD_COUNT}, Current: ${NEW_COUNT}" | ||
|
|
||
| # Find new issues (lines in .new not in old) | ||
| NEW_ISSUES=$(comm -13 <(grep '^\- \[' "$CACHE" 2>/dev/null | sort) <(grep '^\- \[' "${CACHE}.new" | sort) || true) | ||
| if [ -n "$NEW_ISSUES" ]; then | ||
| echo "New issues since last check:" | ||
| echo "$NEW_ISSUES" | ||
| fi | ||
| fi | ||
|
|
||
| mv "${CACHE}.new" "$CACHE" | ||
|
|
||
| - name: Commit updated issue list | ||
| run: | | ||
| if git diff --quiet UPSTREAM_ISSUES.md; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||
| echo "No changes to UPSTREAM_ISSUES.md" | ||
| exit 0 | ||
| fi | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| git add UPSTREAM_ISSUES.md | ||
| git commit -m "chore: update upstream issue watch [skip ci]" | ||
| git push | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub Actions does not make the
secretscontext available injobs.<job_id>.ifconditions, so when a PR or comment triggers this workflow GitHub cannot evaluate this expression and the PR-Agent review job never reaches the action step. Gate the step using an environment value or handle the missing secret inside the job instead.Useful? React with 👍 / 👎.