Setting BITRISE_GIT_MESSAGE from triggered build does not set it


#1

Hi!

I’m trying to set the commit message for triggered build, by putting the following into payload.build_params.environments (as part of the payload):

{“mapped_to”:“BITRISE_GIT_MESSAGE”,“value”:“Deploying flavor XX”,“is_expand”:false}

The build is properly triggered, but I cannot see any message from the build list UI on bitrise.io. Is there anything I’m not doing correctly or is there any issue?

Thanks!


#2

Hi @ldardant,
We are really sorry for the inconvenience! Our website team is working on fixing this issue and it should be resolved soon! I’ll update you here as soon as the fix is deployed!


#3

Also @ldardant regarding the commit message field: If you are using the API the official way that we suggest is using the commit_message field of build_params instead of adding a new env var and updating the value with that. :slightly_smiling_face: The related Build Trigger docs for your reference: https://devcenter.bitrise.io/api/build-trigger/#git-related


#4

You can also check this on the Web UI, and even get a curl call prepared with the value you specify on the web ui:

Click the Start/Schedule a Build button on the app’s page, then switch to Advanced mode in the popup

Specify the Message: parameter

Now scroll to the bottom - you can find the configured curl command there, which includes the parameters you specify in this popup (in this case the message parameter):


#5

Hi @tamasbazsonyi and @viktorbenei

Thanks for your help!

I can confirm COMMIT_MESSAGE is working well, but looking at the documentation of BITRISE_GIT_MESSAGE, I was pretty sure I was using the right env var (https://devcenter.bitrise.io/builds/available-environment-variables/ says: commit message - or the message you specified if you triggered the build manually).

Maybe you could change the documentation?

Again, thanks for your help.

Loïc


#6

Hi @ldardant :wave:

The BITRISE_GIT_MESSAGE env var is read from the commit message API param. From the linked docs:

commit message - or the message you specified if you triggered the build manually. This env var is mapped to commit message in the API.

So this env var is basically holds the value you pass as the commit message via the API. In the past it was possible to overwrite it via custom env vars in the api call but that was never our intention - to set this env var’s value please use the related API parameter (commit_message) instead, as the BITRISE_GIT_MESSAGE variable will be set to that value.

The web UI also only reads the value specified via the API endpoint’s commit_message parameter, it does not read custom env vars, only the documented API parameters.

I hope this helps/explains the situation, let us know if you’d have any questions! :slight_smile:


#7

Hi @viktorbenei,

Thanks for detailed explanation, making it crystal clear!


#8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.