Skip to content

Commit 2dcf9fe

Browse files
kim-emclaude
andcommitted
fix: address Cursor BugBot feedback
- Always close log group (::endgroup::) on both success and failure - Check for pre-existing directories before cloning to prevent data loss - Fix misleading notifications when Zulip config is invalid but verification succeeded Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 56a79b8 commit 2dcf9fe

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/nanoda-daily.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ jobs:
104104
shell: bash
105105

106106
- name: Validate Zulip configuration
107-
if: always() && inputs.notify == 'zulip'
107+
id: validate-zulip
108+
if: (success() || failure()) && inputs.notify == 'zulip'
109+
continue-on-error: true
108110
env:
109111
ZULIP_ORG_URL: ${{ inputs.zulip-org-url }}
110112
ZULIP_API_KEY: ${{ secrets.zulip-api-key }}
@@ -119,7 +121,7 @@ jobs:
119121
fi
120122
121123
- name: Send Zulip notification on success
122-
if: success() && inputs.notify == 'zulip'
124+
if: success() && inputs.notify == 'zulip' && steps.validate-zulip.outcome == 'success'
123125
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5
124126
with:
125127
api-key: ${{ secrets.zulip-api-key }}
@@ -132,7 +134,7 @@ jobs:
132134
✅ nanoda daily verification [succeeded](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) on `${{ github.sha }}`
133135
134136
- name: Send Zulip notification on failure
135-
if: failure() && inputs.notify == 'zulip'
137+
if: steps.lean-action.outcome == 'failure' && inputs.notify == 'zulip' && steps.validate-zulip.outcome == 'success'
136138
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5
137139
with:
138140
api-key: ${{ secrets.zulip-api-key }}

scripts/run_nanoda.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ echo "Checking environment with nanoda external type checker"
99
handle_exit() {
1010
exit_status=$?
1111

12+
# Close the log group before cleanup
13+
echo "::endgroup::"
14+
1215
# Always cleanup temporary files/directories
1316
echo "Cleaning up temporary files..."
1417
rm -rf _lean4export _nanoda_lib _nanoda_export.txt _nanoda_config.json
@@ -18,12 +21,17 @@ handle_exit() {
1821
echo "::error::nanoda check failed"
1922
else
2023
echo "nanoda-status=SUCCESS" >> "$GITHUB_OUTPUT"
21-
echo "::endgroup::"
2224
echo
2325
fi
2426
}
2527
trap handle_exit EXIT
2628

29+
# Check for conflicting directories before we start
30+
if [ -d "_lean4export" ] || [ -d "_nanoda_lib" ]; then
31+
echo "::error::Directories _lean4export or _nanoda_lib already exist. Please remove them before running nanoda."
32+
exit 1
33+
fi
34+
2735
# Step 1: Install Rust if not present
2836
echo "Checking for Rust installation..."
2937
if ! command -v cargo &> /dev/null; then

0 commit comments

Comments
 (0)