feat: mutation-weekly workflow_dispatch 入口 - #108
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthrough本次变更为 ChangesMutation 工作流触发配置
Suggested labels: Merge Risk: ⚪ Minimal · up to This change only adds a manual trigger entry point to the weekly mutation workflow, with no actionable merge-blocking risk remaining after normal checks and review. 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
PR Summary by QodoAdd workflow_dispatch entrypoint to mutation-weekly for manual first run
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Unrestricted dispatch repo execution
|
| description: "Owner/name of the repository to score" | ||
| required: false | ||
| type: string | ||
| default: "Cloudbird-Software/AI_Web_School" |
There was a problem hiding this comment.
1. Unrestricted dispatch repo execution 🐞 Bug ⛨ Security
Adding workflow_dispatch exposes target_repo to manual runs, and the workflow then checks out that repository and executes its test code during mutation scoring, enabling running untrusted repository code on the runner (and increasing compute/abuse risk). This is a new attack surface compared to schedule/workflow_call-only triggering and should be constrained or validated for workflow_dispatch runs.
Agent Prompt
### Issue description
`workflow_dispatch` introduces a user-controllable `inputs.target_repo`, and the workflow checks out and runs mutation scoring against that repo. Because mutation scoring runs the target repo’s tests (code execution), this enables manual runners to execute arbitrary code from arbitrary public repos, increasing abuse/cost/security risk.
### Issue Context
This workflow checks out `inputs.target_repo` into `target/` and runs `run_mutation.py` against it.
### Fix Focus Areas
- .github/workflows/mutation-weekly.yml[8-14]
### Suggested fix
Add an early validation step for `workflow_dispatch` (only) that enforces an allowlist, e.g.:
- Hard-code `target_repo` for dispatch (remove the input entirely), OR
- Make it `type: choice` with approved options, OR
- Add a bash step that verifies `inputs.target_repo` matches an allowed pattern (e.g. `^Cloudbird-Software/AI_Web_School$` or `^Cloudbird-Software/`), and `exit 1` with a clear message when it doesn’t.
Example snippet:
```yaml
- name: Validate target_repo (dispatch)
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
case "${{ inputs.target_repo }}" in
Cloudbird-Software/AI_Web_School) ;;
*) echo "Unsupported target_repo for manual runs"; exit 1;;
esac
```
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
加 workflow_dispatch 触发器以支持手动首跑(AI_Web_School)。Cards: Cloudbird-Software/.github#322
Summary by CodeRabbit