Skip to content

ci(workflows): improve Cursor PR review with error handling and trust flag#9

Merged
fathiraz merged 2 commits intomainfrom
fix/permission-firefox-cookies
Mar 26, 2026
Merged

ci(workflows): improve Cursor PR review with error handling and trust flag#9
fathiraz merged 2 commits intomainfrom
fix/permission-firefox-cookies

Conversation

@fathiraz
Copy link
Owner

@fathiraz fathiraz commented Mar 26, 2026

Summary

Improves the CI workflow for automated PR reviews using the Cursor CLI.

Changes

  • Add working-directory: Ensures the Cursor agent runs in the correct context ()
  • Add --trust flag: Enables non-interactive mode for the Cursor agent in CI environment
  • Implement error handling:
    • Captures stderr to a log file for debugging
    • Validates exit codes and fails the step properly on errors
    • Checks for empty JSON output and reports failure

Why

The previous implementation could silently fail or produce empty results without proper error reporting. These changes ensure:

  1. The agent runs in the correct working directory
  2. The --trust flag is required for non-interactive CI environments
  3. Clear error messages when the review fails or produces no output
  4. Proper CI step failure on any review execution issues

Testing

  • Workflow will be validated on this PR
  • Error handling tested through intentional failures during development

Checklist

  • Workflow syntax validated
  • Error handling paths tested
  • No breaking changes to existing functionality

Summary by cubic

Hardens the Cursor PR review workflow with robust error handling and non-interactive execution, and fixes Firefox extension permissions by removing cookies and adding Firefox-specific manifest settings.

  • Bug Fixes

    • Remove cookies from extension permissions.
    • Convert manifest to a function and add Firefox browser_specific_settings with a stable gecko.id.
    • Ensures manifest builds correctly per browser, resolving Firefox permission/packaging issues.
  • Refactors

    • Set working-directory to ${{ github.workspace }} for the Cursor step.
    • Run the Cursor agent with --trust for CI-safe, non-interactive mode.
    • Capture stderr to a log, validate exit codes, and fail on empty JSON output.

Written for commit 1e41d41. Summary will update on new commits.

… flag

- Add working-directory to ensure consistent execution context
- Add --trust flag to Cursor agent for non-interactive mode
- Implement error logging and validation for JSON output
- Add checks for empty output and proper exit codes
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor auto review

No actionable issues found on changed lines.

No actionable issues found.

Generated automatically when this PR was submitted using Cursor CLI with --model auto.

@fathiraz fathiraz merged commit 299201a into main Mar 26, 2026
4 checks passed
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant