How do I get the "git hash" or release of an application from within a device service?

How do I get the “git hash” or release of an application from within a device service?

  • I see the release on the dashboard for the device.
  • application REST API has should_track_latest_release
  • device REST API has should_be_running__release
  • releases REST API has should_track_latest_release
  • I don’t see anything in the balena supervisor api

I don’t see an environment variable.

Hey the recommended way would be to call the following endpoint: https://www.balena.io/docs/reference/supervisor/supervisor-api/#get-v2applicationsstate

You would read the commit value from the returned state.