Git Commit Buildkite Plugin
A Buildkite plugin to commit and push the results of a command to a git repository.
Example
With no options, commits all changed/added files to $BUILDKITE_BRANCH and pushes to origin with a commit message like Build #4:
steps:
- command: make
plugins:
thedyrt/git-commit#v0.3.0: ~With all options customized:
steps:
- command: make
plugins:
thedyrt/git-commit#v0.3.0:
add: app/
branch: my-branch
create-branch: true
message: "Updated data [$BUILDKITE_BUILD_NUMBER]"
remote: upstream
user:
name: Reid
email: reid@example.comConfiguration
-
add (optional)
A pathspec that will be passed to
git add -Ato add changed files. -
branch (optional, defaults to
$BUILDKITE_BRANCH)The branch where changes will be committed. Since Buildkite runs builds in a detached HEAD state, this plugin will fetch and checkout the given branch prior to committing. Unless we're creating a new branch. See
create-branchbelow. -
create-branch (optional, defaults to
false)When set to true the branch will be created, rather than fetched from the remote.
-
message (optional, defaults to
Build #${BUILDKITE_BUILD_NUMBER})The commit message
-
remote (optional, defaults to
origin)The git remote where changes will be pushed.
-
tag (optional)
If provided, the name of an annotated tag to push to
remote -
tag-message (optional, defaults to
Build #${BUILDKITE_BUILD_NUMBER})The message to associate with the annotated
tag -
user.email (optional, defaults to
sre-team@quantopian.com)If given, will configure the git user email for commits to the repo.
-
user.name (optional, defaults to
Buildkite CI)If given, will configure the git user name for commits to the repo.
-
pull-request (optional, defaults to
false)If
true, opens a pull request for the commit. Requires GITHUB_TOKEN env -
pull-request-labels (required if pull-request is true)
Comma-separated string of labels to add to pull request
-
pull-request-message (required if pull-request is true)
Message to provide PR
-
pull-request-base-branch (optional, defaults to
master)The branch where changes are committed will be merged into this branch by merging the pull request.
-
pull-request-wait-for-merge (optional, defaults to
true)If true, the plugin will wait for the created PR to be merged before continuing
-
pull-request-wait-for-merge-timeout-mins (optional, defaults to
10)The number of minutes to wait for PR merge until exiting non-zero
Tests / Linting
To run the tests of this plugin, run
docker-compose run --rm testsTo run the Buildkite Plugin Linter, run
docker-compose run --rm lintLicense
MIT (see LICENSE)