Skip to content

Commit

Permalink
Send a user-agent
Browse files Browse the repository at this point in the history
Make it easier to identify git-buildkite API usage.
  • Loading branch information
sj26 committed Sep 11, 2023
1 parent d105b16 commit a93be40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion git-buildkite
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

VERSION="v0.6.0"

BUILDKITE_ORGANIZATION="${BUILDKITE_ORGANIZATION:-$(git config buildkite.organization)}"

if [[ -z "$BUILDKITE_ORGANIZATION" && -n "$BUILDKITE_ACCOUNT" ]]; then
Expand Down Expand Up @@ -139,7 +141,8 @@ function build() {
# status code and the response body on error, so we have to check
# the content for errors later.
curl -# "https://api.buildkite.com/v2/organizations/${BUILDKITE_ORGANIZATION}/pipelines/${BUILDKITE_PIPELINE}/builds" \
-H "Authorization: Bearer $BUILDKITE_API_KEY" \
-A "git-buildkite/${VERSION}" \
-H "Authorization: Bearer ${BUILDKITE_API_KEY}" \
-X POST \
-F "branch=$1" \
-F "commit=$2" \
Expand Down

0 comments on commit a93be40

Please sign in to comment.