Skip to content

Agent does not verify requested commit-ish is in requested branch #409

@ticky

Description

@ticky

Currently, if you manually trigger a build, specifying both a branch and a commit-ish, the Agent treats the specified commit-ish as though it were in the specified branch.

In cases where you require specific things to happen on specific branches (i.e. deploy from master), this can cause issues.

A workaround for now is to implement a check in your own build scripts;

if ! git branch -r --contains "${BUILDKITE_COMMIT}" | grep -q "origin/${BUILDKITE_BRANCH}" 2> /dev/null; then
  echo "The commit SHA ${BUILDKITE_COMMIT} was not found in ${BUILDKITE_BRANCH}. Exitting..."
  exit 1
fi

(thanks to Jacob from Envato for investigation of this issue)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions