You can check the available environment variables in the aws code build page, the commit sha would be CODEBUILD_RESOLVED_SOURCE_VERSION in particular