ci: fix double CI runs on PR pushes #75
Reference in New Issue
Block a user
Delete Branch "fix/ci-double-trigger"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Changes 'on: [push, pull_request]' to only trigger push on main, while keeping pull_request for all PRs. Prevents double workflow runs when pushing to a branch with an open PR.
=== PR REVIEW SUMMARY ===
Branch: fix/ci-double-trigger → main
PR: #75
Files reviewed: 2 (own commits)
Dimensions checked: code, build, CI, docs, quality
=== COMMITS REVIEWED ===
[1/2]
00b6f20— ci: only trigger push on main to avoid double CI runs[2/2]
e7634f6— chore: load AGENTS.md as instructions and block direct pushes to main=== FINDINGS ===
[INFO] .gitea/workflows/ci.yaml — CI trigger change (commit
00b6f20)Change:
on: [push, pull_request]→on: push: { branches: [main] } + pull_requestAnalysis: Correctly avoids double CI runs when pushing to a branch with an open PR.
Edge cases verified:
No edge cases missed. The Gitea Actions YAML syntax is valid.
[INFO] opencode.json — AGENTS.md as instructions (commit
e7634f6)Change: Added
"instructions": ["AGENTS.md"]and changed"git push main": "deny"Analysis:
dependency installation rules, CI conventions, branch strategy, build/test commands.
✅ Correct and useful. The file is directly usable as agent instructions.
"git push main": "ask"→"deny"blocks direct pushes to main entirely.Combined with the existing
"git push origin main": "deny", both variants are now blocked.✅ Aligns perfectly with branch strategy: "Never push directly to main."
"instructions"key uses correct OpenCode JSON schema position (under$schema, beforepermission).[MINOR] AGENTS.md — Stale CI image version reference
File: AGENTS.md (from merged PR #27, not this PR's own change)
Detail: Line 7 says CI uses
gitea.tap-tap.win/taptap/fastsync-ci:v7, but CI now usesgitea.tap-tap.win/taptap/fastsync-ci:v9. Since this PR activates AGENTS.md as AIinstructions, an AI agent reading this could be misled about the CI image version.
However, AGENTS.md does note later that ":v7 reflects the previous Dockerfile state",
acknowledging it is stale. This is pre-existing and non-blocking, but worth updating
in a follow-up PR.
[VERIFIED] ci.yaml v9 image (from merged PR #25)
Analysis: Container bumped to
fastsync-ci:v9which includes lcov, valgrind, clang,libclang-rt-18-dev. ✅ Follows the AGENTS.md rule: "never add apt-get/pip install to
CI workflows — use the custom Docker image." No apt-get/pip install steps added.
[VERIFIED] ctest integration (from merged PR #25)
Analysis:
./build/tests→ctest --test-dir build --output-on-failure -j$(nproc).CMakeLists.txt on the PR branch includes
enable_testing()andadd_test(NAME unit_all COMMAND tests)— both required by ctest. ✅[VERIFIED] pytest path change (from merged PR #25)
Analysis:
tests/→tests/integration/. Verifiedtests/integration/exists onorigin/mainand contains:__init__.py,common.py,test_features.py,test_preflight.py,test_ssh.py,test_tcp.py,test_tls.py. ✅[VERIFIED] New jobs — fuzz-build, coverage, valgrind (from merged PR #25)
Analysis:
build-fuzzdirectory. No conflict. ✅build/but in isolated container. No conflict. ✅build/in isolated container.FASTSYNC_UNDER_VALGRINDenv varproperly skips fork-based tests that fail under valgrind. No conflict. ✅
[VERIFIED] Commit quality
00b6f20 ci: only trigger push on main to avoid double CI runs— clear, conventional, focused ✅e7634f6 chore: load AGENTS.md as instructions and block direct pushes to main— clear, conventional, focused ✅[VERIFIED] No secrets, keys, or credentials committed ✅
[VERIFIED] No C code changes in the 2 PR commits — no memory/thread/protocol/security concerns ✅
[VERIFIED] Backward compatibility maintained (no protocol version changes) ✅
=== VERDICT ===
[PASS] — APPROVE
All 2 commits in this PR are correct and focused. The CI trigger change eliminates
double CI runs. The opencode.json changes load useful instructions and enforce branch
strategy. All merged content from PRs #25-#28 is compatible. The only minor finding
(stale v7 reference in AGENTS.md) is pre-existing and non-blocking.