Skip to content

merge-target-branch failing on git config with too many arguments #9

@initvector

Description

@initvector

The portion of merge-target-branch.sh responsible for configuring the GitHub user does not quote its values. This means the values can be treated as multiple arguments. For example:

  1. git log --format='%an' $CIRCLE_SHA1^! could return "John Q Doe".
  2. The outer command then becomes git config --global user.name John Q Doe.
  3. Git rejects the command and the overall script fails, because there are too many arguments. "John Q" would technically complete successfully, although the global value of user.name would actually be "John".

# setup the github user
git config --global user.email $( git log --format='%ae' $CIRCLE_SHA1^! )
git config --global user.name $( git log --format='%an' $CIRCLE_SHA1^! )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions