Skip to content

[BUG] [v0.0.7] cortex github uninstall deletes unrelated workflow files whose contents merely mention cortex #46726

Description

@marvinayisi

Project

cortex

Description

cortex github uninstall can delete an unrelated workflow file if the file merely contains the word cortex.

repro.mp4

Error Message

$ cortex github uninstall --path /tmp/cortex-gh-uninstall.XXXXXX --workflow-name ci --force
Cortex workflow removed successfully!
   Removed: /tmp/cortex-gh-uninstall.XXXXXX/.github/workflows/ci.yml

exists_after=no

Debug Logs

$ cat /tmp/cortex-gh-uninstall.XXXXXX/.github/workflows/ci.yml
name: CI
on: [push]
# notify cortex team on failure
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - run: echo unrelated

$ cortex github uninstall --path /tmp/cortex-gh-uninstall.XXXXXX --workflow-name ci --force
# file is deleted even though it was not generated by Cortex

System Information

cortex 0.0.7 (7954d02 2026-04-03)
macOS 26.1 (25B78)
Darwin 25.1.0 arm64
CPU: Apple M2
RAM: 8 GB

Screenshots

repro.mp4

Steps to Reproduce

  1. Create a temporary directory with .github/workflows/ci.yml.
  2. Put an unrelated workflow in that file, but include the word cortex somewhere in the contents.
  3. Run cortex github uninstall --path <dir> --workflow-name ci --force.
  4. Check whether the original file still exists.

Expected Behavior

github uninstall should only remove workflows that were actually generated by Cortex, not arbitrary workflows whose contents happen to mention the word cortex.

Actual Behavior

The command treats any matching file as a Cortex workflow if its contents contain Cortex or cortex, then deletes it.

Additional Context

Code path: /Users/odeili/Projects/platform/cortex/src/cortex-cli/src/github_cmd.rs. run_uninstall() verifies the target file using a loose content.contains("Cortex") || content.contains("cortex") check before removal. Duplicate check on April 5, 2026: searched github uninstall deletes unrelated workflow containing cortex string, github uninstall false positive removes non cortex workflow, and cortex github uninstall removes unrelated workflow containing cortex; I did not find a matching Cortex issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingideIssues related to IDEvalidValid issue

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions