# Avoid caching zed build script if git state has changed \(\#3610\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/b3e1514b00660930c39953338c25e42c1e84c778)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: b3e1514b00660930c39953338c25e42c1e84c778

Requested commit: b3e1514b00660930c39953338c25e42c1e84c778

Commit: b3e1514b00660930c39953338c25e42c1e84c778

Tree: 150b179fd1ce4b531ba7f57356519d37e70ceafb

Author: Max Brunsfeld

Committer: GitHub

## Message

```
Avoid caching zed build script if git state has changed (#3610)

@as-cii and @SomeoneToIgnore noticed a bug where Zed nightly would
continuously report that an update was available. This nightly
auto-update logic depends on the `ZED_COMMIT_SHA` constant, which is
compiled into the app via an rustc environment variable that is assigned
in the `zed2` build script.

I think the bug was caused by the `zed2` build script's output being
cached on our CI, when building the nightly app bundle. The result was
that the `publish-nightly` action updated the "current SHA" for nightly,
but uploaded an artifact whose `ZED_COMMIT_SHA` was cached from an
earlier version.

I've added a line to the `build.rs` that triggers a rerun if the
`.git/logs/HEAD` file has been changed. I think this should prevent the
unwanted caching.
```

## Parents

- [cc97b0462798443e8bda092c4610ef6e44488827](https://git.cafe/gitcafe/zed/commit/cc97b0462798443e8bda092c4610ef6e44488827?format=markdown)

- [e3ed3b8c1c569d75fe46ebbb33328db6a332266e](https://git.cafe/gitcafe/zed/commit/e3ed3b8c1c569d75fe46ebbb33328db6a332266e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/b3e1514b00660930c39953338c25e42c1e84c778?format=markdown)
