fix(ci): fix triage prompt variable expansion, bot identity, and model secret - #4778
Conversation
…ecret
- Replace literal ${TARGET_NUMBER} with ${{ steps.resolve.outputs.number }}
in triage prompt so the model receives the actual issue/PR number
- Switch comment trigger from contains() to startsWith() to prevent
bot's own comments (which reference @qwen-code /triage) from
re-triggering the workflow
- Use QWEN_CODE_BOT_TOKEN instead of GITHUB_TOKEN so comments are
posted by the bot account rather than github-actions[bot]
- Switch OPENAI_MODEL to QWEN_PR_REVIEW_MODEL in both triage and
issue followup bot workflows
📋 Review SummaryThis PR fixes critical issues in the triage CI workflow that caused silent failures when triggered via comment, along with alignment improvements for bot identity and model configuration. The changes are focused, well-motivated, and address the root causes identified in the PR description. 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
There was a problem hiding this comment.
Pull request overview
This PR updates the CI workflows for the triage and issue follow-up bots to prevent silent failures on comment-triggered triage runs, reduce accidental self-triggering, and align bot identity + model configuration across workflows.
Changes:
- Fix triage prompt interpolation by switching from a literal
${TARGET_NUMBER}placeholder to a GitHub Actions expression (${{ steps.resolve.outputs.number }}). - Tighten the comment trigger match from
contains()tostartsWith()to avoid accidental triggers from bot-authored descriptive text. - Align bot identity and model secret usage by switching to
QWEN_CODE_BOT_TOKEN || CI_BOT_PATfor GitHub auth andQWEN_PR_REVIEW_MODELfor the model selection.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/qwen-triage.yml | Fixes prompt number expansion, tightens comment trigger matching, and switches triage to use the bot token + QWEN_PR_REVIEW_MODEL. |
| .github/workflows/qwen-issue-followup-bot.yml | Switches model secret to QWEN_PR_REVIEW_MODEL to match the triage workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: 'Run Qwen Triage' | ||
| uses: 'QwenLM/qwen-code-action@5fd6818d04d64e87d255ee4d5f77995e32fbf4c2' | ||
| env: | ||
| GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | ||
| GITHUB_TOKEN: '${{ secrets.QWEN_CODE_BOT_TOKEN || secrets.CI_BOT_PAT }}' | ||
| TARGET_NUMBER: '${{ steps.resolve.outputs.number }}' |
There was a problem hiding this comment.
Both QWEN_CODE_BOT_TOKEN and CI_BOT_PAT are already configured — the followup bot has been using them without issue. No fallback needed here.
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
Verification ReportEnvironment: macOS Darwin 25.4.0, code review + YAML validation (no source code to build/test) Verification MethodThis PR modifies only GitHub Actions workflow YAML files — no source code changes, no unit tests applicable. Verification performed via:
YAML Validation
Fix-by-Fix Review
Additional Observations
Verdict✅ Ready to merge — All four fixes are logically correct, YAML is syntactically valid, and changes are minimal and well-scoped. Verified by: wenshao |
wenshao
left a comment
There was a problem hiding this comment.
[Suggestion] Three other bot workflows (qwen-automated-issue-triage.yml:53, qwen-scheduled-issue-triage.yml:65, qwen-code-pr-review.yml:112) still reference secrets.OPENAI_MODEL while this PR migrates two workflows to secrets.QWEN_PR_REVIEW_MODEL. If OPENAI_MODEL is deprecated or rotated, those workflows will silently break. Consider migrating all bot workflows in this PR or a tracked follow-up.
(Posted as body-level comment because the affected files are not in this PR's diff.)
— qwen3.7-max via Qwen Code /review
The prompt now references steps.resolve.outputs.number directly via GitHub Actions expression syntax, so the intermediate env var is no longer needed.
…rtsWith intent - QWEN_PR_REVIEW_MODEL is a repo variable, not a secret — fix secrets.QWEN_PR_REVIEW_MODEL to vars.QWEN_PR_REVIEW_MODEL in both triage and followup bot workflows - Add inline comment explaining why startsWith is used instead of contains for the comment trigger condition
YAML >- folded block scalar concatenates all lines into one string, so # comments inside the if: expression become part of the expression text and cause actionlint to fail. Move the comment above the if: key where it is a normal YAML comment.
doudouOUC
left a comment
There was a problem hiding this comment.
Review Summary
PR 目标明确,修了 4 个互相关联的 CI 问题,改动量很小(+7/-7),commit 历史清晰(每个 commit 做一件事),PR 描述质量很高——有 root cause 分析、本地验证脚本、before/after evidence。
主要建议补上 GH_TOKEN(见 inline comment),其余问题不阻塞合入。整体是一个高质量的 CI fix PR。
🤖 Generated with Qwen Code
gh CLI reads GH_TOKEN before GITHUB_TOKEN. Without it, gh calls inside qwen-code-action fall back to the default Actions token (lower permissions, wrong identity). Aligns with followup bot.
What this PR does
Fixes several issues in the triage and issue followup bot CI workflows that caused triage to silently fail on comment-triggered runs, and aligns bot identity and model configuration.
Why it's needed
When
@qwen-code /triagewas commented on a PR (e.g. #4629), the triage workflow triggered and succeeded, but produced no output. Root cause: the prompt contained literal${TARGET_NUMBER}which GitHub Actions YAML does not shell-expand — the model received the string${TARGET_NUMBER}instead of the actual number and gave up asking for clarification. Additionally, the bot's own triage comments contain@qwen-code /triageas descriptive text, which could re-trigger the workflow via thecontains()check.Reviewer Test Plan
How to verify
qwen-triage.ymlline 82 — confirm${{ steps.resolve.outputs.number }}replaces the old${TARGET_NUMBER}if:condition — confirmstartsWith()replacescontains(), so only comments beginning with@qwen-code /triagetrigger the workflow (not bot comments that mention it mid-sentence)GITHUB_TOKENin the action step usesQWEN_CODE_BOT_TOKEN || CI_BOT_PATQWEN_PR_REVIEW_MODELinstead ofOPENAI_MODELEvidence (Before & After)
Before: commenting
@qwen-code /triageon #4629 triggered the workflow (run 26944303602) but the model replied "I need the issue or PR number" and produced no triage output.After: the prompt will contain the actual number (e.g.
/triage 4629), the model can execute the triage skill correctly.Local verification
Simulated GitHub Actions expression evaluation against the modified workflow files — all tests passed:
Tested on
CI-only change, no local runtime needed.
Risk & Scope
QWEN_PR_REVIEW_MODELsecret must be configured in repo settings, otherwise both workflows will get an empty model valueqwen-code-pr-review.ymlhas separate bugs (missingissue_commenttrigger, keyword mismatch) — tracked in feat(ci): add PR review workflow using bundled /review skill #4549Linked Issues
Related to #4768
中文说明
修复 triage 和 issue followup bot CI workflow 的几个问题:
${TARGET_NUMBER}在 GitHub Actions YAML 中是字面文本,模型收到的是字符串${TARGET_NUMBER}而不是实际的 issue/PR 号,导致 triage 无输出。改为${{ steps.resolve.outputs.number }}让 GitHub Actions 在解析时替换为实际值。@qwen-code /triage文字,contains()会误匹配。改为startsWith()只匹配以该关键词开头的评论。GITHUB_TOKEN(github-actions[bot])切换为QWEN_CODE_BOT_TOKEN,与 followup bot 保持一致。OPENAI_MODEL切换为QWEN_PR_REVIEW_MODEL。