Skip to content

chore: stop tracking the machine-local .env - #227

Open
alanvardy wants to merge 1 commit into
mainfrom
chore/untrack-dotenv
Open

alanvardy wants to merge 1 commit into
mainfrom
chore/untrack-dotenv

Conversation

@alanvardy

Copy link
Copy Markdown
Owner

Why

.env holds the machine-local Xcode Cloud credentials (ASC_KEY_ID / ASC_ISSUER_ID) and is explicitly documented as "Gitignored, machine-local, never committed" — but it is tracked on main (added in 12ec808 / a339a95, and again in several dependabot branches). This repo is public, so it has been shipping.

Root cause: marshal's _marshal_setup_worktree copies the real .env into each new worktree, and those worktrees were branched from commits that predate the .env line in .gitignore. A broad git add . staged it once, and later rebases faithfully replayed the addition — an ignore rule cannot untrack an already-recorded file.

Only the Key ID and Issuer ID leaked; the AuthKey_*.p8 private key was never committed, so these values alone cannot authenticate to App Store Connect. Still, they should not be in the repo.

What

git rm --cached .env — untracks the file while leaving it on disk, so .gitignore:51 finally takes effect (git check-ignore -v .env now matches).

Follow-up (not in this PR)

.env is already listed in .gitignore and is documented as machine-local
(ASC key id / issuer id for the xcode-cloud helper). It was committed by
accident from a worktree branched before the ignore rule existed, and the
rebases replayed the addition. Untrack it (the file stays on disk) so the
ignore rule takes effect and it stops shipping to this public repo.
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