Skip to content

API builds does not override TRAVIS_COMMIT_MESSAGE #8641

@BanzaiMan

Description

@BanzaiMan
Contributor

Description

Issuing an API build request with message value does not change the TRAVIS_COMMIT_MESSAGE.

Steps to reproduce

body='{
 "request": {
 "message": "Override the commit message: this is an api request",
 "branch":"master",
 "config": {
   "env": {
     "matrix": ["TEST=unit"]
   },
   "script": "echo FOO"
  }
}}'

curl -s -X POST \
 -H "Content-Type: application/json" \
 -H "Accept: application/json" \
 -H "Travis-API-Version: 3" \
 -H "Authorization: token xxxxxx" \
 -d "$body" \
 https://api.travis-ci.org/repo/travis-ci%2Ftravis-core/requests

Expected behavior

$TRAVIS_COMMIT_MESSAGE is set to the value given in the payload: "Override the commit message: this is an api request".

Actual behavior

It is the same as one given in the latest commit in git.

Discussion

Currently, $TRAVIS_COMMIT_MESSAGE is set by reading the git data (https://github.com/travis-ci/travis-build/blob/1f67b6407de09a7a972f8ff568d96b8bd2ef7ba9/lib/travis/build/env/builtin.rb#L43), not the payload passed to travis-build. This is done in order to avoid certain issues when passing non-ASCII characters (#965 (comment)).

Activity

changed the title [-]API builds cannot override `TRAVIS_COMMIT_MESSAGE`[/-] [+]API builds does not override `TRAVIS_COMMIT_MESSAGE`[/+] on Oct 26, 2017
stale

stale commented on Apr 13, 2018

@stale

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

stale

stale commented on Jan 26, 2019

@stale

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please respond before the issue is closed, or open a new one after. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

AlexHarrisonIBM

AlexHarrisonIBM commented on Sep 21, 2020

@AlexHarrisonIBM

So is this still an issue

2 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @BanzaiMan@mteodori@AlexHarrisonIBM

        Issue actions

          API builds does not override `TRAVIS_COMMIT_MESSAGE` · Issue #8641 · travis-ci/travis-ci