Skip to content

[eas-cli] Read .easignore next to eas.json, not only at the git root - #4387

Open
cpruijsen wants to merge 3 commits into
expo:mainfrom
cpruijsen:fix/issue-4259
Open

cpruijsen wants to merge 3 commits into
expo:mainfrom
cpruijsen:fix/issue-4259

Conversation

@cpruijsen

Copy link
Copy Markdown

Why

Read .easignore next to eas.json when that file exists, otherwise from the git repository root. Fixes #4259.

eas-cli always resolved .easignore by joining the filename onto the git repository root (git rev-parse --show-toplevel). A file next to eas.json in a monorepo app directory was silently ignored.

https://github.com/expo/fyi/blob/main/eas-build-archive.md says: if EAS_PROJECT_ROOT is unset, place .easignore in the same directory as your eas.json. That path was never consulted. The same lookup is used for requireCommit pruning (git ls-files --exclude-from), for Ignore during the working-tree copy, and for isFileIgnoredAsync. Monorepos with one .easignore per app had to copy it to the repo root (a race in CI) or disable VCS with EAS_NO_VCS=1 EAS_PROJECT_ROOT=....

How

Resolve .easignore in the EAS project directory when that file exists, otherwise fall back to the repository / copy root. Pattern matching and prefix anchoring are unchanged: git ls-files --exclude-from still applies the file to the repo it is listing, and Ignore still uses an empty prefix against the copy root.

VcsClientContextField already had the project directory (the same path used for eas.json) and now passes it into resolveVcsClient. Both GitClient and NoVcsClient use it.

Project-directory .easignore wins; git-root file is the fallback. Do not merge with .gitignore. No warning when both files exist (debug log only). Merge with .gitignore was suggested on the issue. Another option is to warn/error if both files exist. The reporter's patch is lookup-only, and existing tests document that .easignore replaces .gitignore. Precedence when both exist was listed as an open question and no maintainer has answered it. Can switch to a warn when both exist, or a merge with .gitignore.

Test Plan

  • cd packages/eas-cli && yarn test src/vcs/__tests__/local-test.ts src/vcs/clients/__tests__/noVcs.test.ts src/vcs/clients/__tests__/git.test.ts (56 passed)
  • Nested apps/app-a/.easignore is used by Ignore, GitClient.isFileIgnoredAsync, GitClient.makeShallowCopyAsync (requireCommit true and false), and NoVcsClient.isFileIgnoredAsync
  • Project file wins over a root .easignore; root file is used when the project has none
  • Existing root-only .easignore / .gitignore cases still pass
  • Optional: eas build:inspect --stage archive from apps/app-a in a real monorepo, with .easignore only next to that app's eas.json

@github-actions

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
packages/eas-cli/** @douglowder

Generated by CodeMention

Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead.

@cpruijsen
cpruijsen force-pushed the fix/issue-4259 branch 3 times, most recently from 7e2c5f2 to 1d0778f Compare September 22, 2026 08:47
@douglowder

Copy link
Copy Markdown
Contributor

eas-cli now uses changesets for changelogs (#4580). The required "Check for a changeset" check fails on PRs that edit CHANGELOG.md.

To update this PR:

  1. Revert the changes to CHANGELOG.md.
  2. Run yarn changeset, select the changed packages and the bump type, and write the summary.
  3. Commit the new file in .changeset/.

The release adds the PR link and the author to the entry. If this PR needs no changelog entry, revert the CHANGELOG.md changes and add the "no changelog" label.

@cpruijsen

Copy link
Copy Markdown
Author

I reverted the CHANGELOG.md edit and added a changeset (.changeset/read-easignore-project-dir.md, eas-cli patch). I merged current main into the branch so that it has the changesets setup.

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.

.easignore next to eas.json is ignored, the git root one is used instead

2 participants