I wanted to keep track of the commit SHA attached to each deploy that I can then reference from a bot I’ve been working on.
To do so I’m running flyctl deploy --remote-only --image-label "deployment-$GITHUB_SHA" -a ${{ matrix.app }} from the GH workflow file.
Then from the bot I want to get access to that label (and thus the SHA). I’ve been playing around with the graphql playground I noticed that if I run this query
I decided to take a closer look here; but the short version is: the release tracking for images’ tags has been left relatively naive and will likely stay that way for the time being.
The longer context version: We don’t use tags to refer to images, especially for informing historical context in part because it’s unreliable to reference images by tag. This is because a particular image, in terms of container images, can have multiple tags. As an example latest, v1, v1.0 could all associate to one image. You can also reuse tags for images - like how you see projects retagging latest to whatever the newest image is at the time.
Given that context, a release is more reliably associated to a particular image (by its digest) than by a moving-target tag.
Due to these caveats, I wouldn’t recommend using the release image tag from our API this way today.