Repository navigation
api | docs: pass the git commit to builds and running services - #41
Merged
bbedward merged 1 commit intoOct 19, 2026
Merged
Conversation
UNBIND_GIT_SHA and UNBIND_GIT_BRANCH reach Dockerfile builds as ARGs, railpack's build step as env, and every pod of a git service as env. Both names are reserved for new variables. UNB-416
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds and pods never got the commit they came from, so apps that stamp their version from CI report
development.UNBIND_GIT_SHAandUNBIND_GIT_BRANCHnow reach:ARG, through the existing ARG detection.buildstep only. Railpack mounts the hash of all secrets into every step (buildkit/build_llb/build_graph.go), so passing a per-commit value as a secret would rerun install on every commit. The build step copies the source and reruns anyway.TestAddBuildStepVariablesKeepsInstallCachedchecks that install's LLB stays the same across commits.commit_sha/git_branchon redeploys that skip the build, rollouts after variable changes, and removing the active deployment. Those paths rebuildEnvVarsbecause it is pruned from stored resource definitions.The SHA is the one the builder actually cloned. The branch comes from the ref; tag builds get no branch. The branch is part of the image config digest, so two branches at one commit don't share an image with the wrong branch baked in. That rotates railpack's cache-mount key and image tags once after upgrade. The registry cache key doesn't change.
Both names are reserved for new variables, the same way endpoint keys are. A value already stored under one of them is overridden by Unbind's.
Docs: new Git commit section in Variables, plus a note in Builds.
fixes UNB-416