Skip to content

fix(ci): prevent linter crash on deleted files#4952

Merged
walterbender merged 1 commit intosugarlabs:masterfrom
Inuth0603:fix/linter-deleted-files
Dec 31, 2025
Merged

fix(ci): prevent linter crash on deleted files#4952
walterbender merged 1 commit intosugarlabs:masterfrom
Inuth0603:fix/linter-deleted-files

Conversation

@Inuth0603
Copy link
Contributor

Fixes #4951

Description
This PR fixes a bug in the Lint updated JavaScript files workflow where the CI fails with "No files matching the pattern" if a Pull Request deletes files (e.g., electron-main.js).

Root Cause
The git diff command in the workflow was including deleted files in its output. ESLint then attempted to lint these non-existent files, causing a crash.

Changes

  • Updated .github/workflows/linter.yml to include the --diff-filter=ACMRT flag.
  • This ensures git diff only returns Added, Copied, Modified, Renamed, or Type-changed files, explicitly excluding Deleted (D) files.

Testing
Verified locally:

  1. Created a dummy file and committed it.
  2. Deleted the file and committed the deletion.
  3. Ran git diff --diff-filter=ACMRT --name-only HEAD~1 HEAD and confirmed it returns an empty list instead of the deleted filename.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@walterbender walterbender merged commit e4219ba into sugarlabs:master Dec 31, 2025
5 checks passed
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.

fix(ci): prevent linter crash on deleted files

2 participants