Feature request: Specify a commit hash on build

I think it would be useful to be able to specify a commit hash to eas build. The usecase for this is: I run an internal build for testing (apk on Android, adhoc on iOS). Neither of those is suitable for store submission (Android wants aab, iOS wants something else as well).

So what I would like to do, is when a build gets approved after testing, is run the exact same build for store submission. To me, it seems like the easiest way to get ‘the exact same’ is by using the commit hash that I used for the internal build. Not only because it’s part of the metadata that is available to me in the webhook call for the completed internal build, but also because it’s a lot easier than relying on branches that hopefully haven’t changed in the meantime, or any other method that I’d need to use manually to achieve this.

I could of course checkout the commit myself manually, but as eas build already performs a shallow clone, it wouldn’t be too much effort to follow that up with git checkout <commit_sha> if I pass one in as command-line parameter.

I’d be happy to implement this myself in the eas-cli if you think this is a valid use case.

I don’t see any benefits of this, running e.g. eas build --commit-hash [hash] is not easier/simpler/shorter than git checkout hash && eas build. How would this help you?

2 Likes

@wkozyra I think we can write this one off under ‘insufficient git knowledge’. I wondered how I could point to a specific commit hash, and every single online thread I found about ‘clone a specific commit hash’ performed a reset/checkout of an hash after cloning, so I assumed that was the order things had to be in. And with the CLI doing the cloning, that brought me here.

I have tested your approach, and apparently that works perfectly fine (of course), so there’s absolutely no reason why the CLI should be bothered to do that for me :wink:

Problem solved. Thanks!

2 Likes