From 81fa6843d9db4af59253cda216a5b8b921c4b255 Mon Sep 17 00:00:00 2001 From: cexll Date: Thu, 5 Feb 2026 10:35:29 +0800 Subject: [PATCH] fix(release): auto-generate release notes from git history - Add fetch-depth: 0 to get full git history - Generate release notes from commits between tags - Include full changelog link in release notes - Simplify do skill stop-hook by removing promise detection Generated with SWE-Agent.ai Co-Authored-By: SWE-Agent.ai --- .github/workflows/release.yml | 29 ++++++++++++++++++++++++++++- skills/do/hooks/stop-hook.py | 27 +++++++-------------------- 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 73367d7..8b70529 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,6 +91,33 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate Release Notes + id: release_notes + run: | + # Get previous tag + PREVIOUS_TAG=$(git tag --sort=-version:refname | grep -v "^${{ github.ref_name }}$" | head -n 1) + + if [ -z "$PREVIOUS_TAG" ]; then + echo "No previous tag found, using all commits" + COMMITS=$(git log --pretty=format:"- %s (%h)" --no-merges) + else + echo "Generating notes from $PREVIOUS_TAG to ${{ github.ref_name }}" + COMMITS=$(git log ${PREVIOUS_TAG}..${{ github.ref_name }} --pretty=format:"- %s (%h)" --no-merges) + fi + + # Create release notes + cat > release_notes.md < str: phases_done = current_phase >= max_phases - promise_met = False - if completion_promise: - if stdin_payload and completion_promise in stdin_payload: - promise_met = True - else: - body = get_body(state_file) - if body and completion_promise in body: - promise_met = True - - if phases_done and promise_met: + if phases_done: + # 阶段已完成,清理状态文件并允许退出 + # promise 检测作为可选确认,不阻止退出 try: os.remove(state_file) except Exception: pass return "" - if not phases_done: - return (f"do loop incomplete: current phase {current_phase}/{max_phases} ({phase_name}). " - f"Continue with remaining phases; update {state_file} current_phase/phase_name after each phase. " - f"Include completion_promise in final output when done: {completion_promise}. " - f"To exit early, set active to false.") - else: - return (f"do reached final phase (current_phase={current_phase} / max_phases={max_phases}, " - f"phase_name={phase_name}), but completion_promise not detected: {completion_promise}. " - f"Please include this marker in your final output (or write it to {state_file} body), " - f"then finish; to force exit, set active to false.") + return (f"do loop incomplete: current phase {current_phase}/{max_phases} ({phase_name}). " + f"Continue with remaining phases; update {state_file} current_phase/phase_name after each phase. " + f"Include completion_promise in final output when done: {completion_promise}. " + f"To exit early, set active to false.") def main(): project_dir = os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd())