Compare commits

..

1 Commits

Author SHA1 Message Date
cexll
81fa6843d9 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 <noreply@swe-agent.ai>
2026-02-05 10:35:29 +08:00
2 changed files with 35 additions and 21 deletions

View File

@@ -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 <<EOF
## What's Changed
${COMMITS}
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREVIOUS_TAG}...${{ github.ref_name }}
EOF
cat release_notes.md
- name: Download all artifacts
uses: actions/download-artifact@v4
@@ -108,6 +135,6 @@ jobs:
uses: softprops/action-gh-release@v2
with:
files: release/*
generate_release_notes: true
body_path: release_notes.md
draft: false
prerelease: false

View File

@@ -78,32 +78,19 @@ def check_state_file(state_file: str, stdin_payload: str) -> 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())