dify
dify copied to clipboard
autofix fails on PRs touching api/ because a .github test file on main is not Ruff-formatted
Self Checks
- [x] I have read the Contributing Guide and Language Policy.
- [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report, otherwise it will be closed.
- [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- [x] Please do not modify this template :) and fill in all the required fields.
Dify version
main (after #39238)
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
- Open any PR against
mainthat changes a file underapi/and does not touch.github/. - The
autofixworkflow runscd api && uv run ruff format ... - Ruff reformats
.github/scripts/tests/test_check_hotfix_cherry_picks.py, which was added in #39238 without the repo's Ruff formatting (api/.ruff.toml). Oneself.commit(...)call intest_unavailable_sourceis split over three lines; Ruff joins it into one.
Local check on current main: cd api && uvx [email protected] format --diff .. reports "1 file would be reformatted" for that file.
✔️ Expected Behavior
main is already formatted, so autofix makes no change outside the PR's own files, and the required check passes.
❌ Actual Behavior
autofix.ci stops with: "The autofix.ci action is not allowed to modify the .github directory." The required autofix check fails on every PR that touches api/.
Spot on. autofix.ci hard-blocks changes inside .github/ by design to prevent unauthorized workflow modifications.