buildkite / buildkite/agent

Buildkite trigger issue with branch

Open
#1,546 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.1k
Forks
378
Avg merge
2d 6h
Merged PRs (30d)
74

Description

Builkite trigger failed when passing branch.

I have a buildkite build where I get user input and according to these input, I will trigger new build. I am getting this error in new build:

```
$ git fetch -v --prune -- origin "$(buildkite-agent meta-data get GIT_REF_INPUT)"
--
  | fatal: invalid refspec '$(buildkite-agent meta-data get GIT_REF_INPUT)'
  | ⚠️ Warning: Checkout failed! exit status 128 (Attempt 3/3 Retrying in 2s)
```

Here is how I use trigger:
```
- trigger: legacy-service-core
build:
branch: "\"$(buildkite-agent meta-data get GIT_REF_INPUT)\""
```
Is there any way we can go around this issue? It is very critical to have the ability to trigger based on use inputs steps

Contributor guide

Open the contributing guide

Research direction

Start with the trigger configuration and the checkout command shown in the issue, then reproduce a triggered build whose branch is supplied by buildkite-agent meta-data. Compare the value passed to the trigger with the refspec received by git fetch. Done means a user-provided branch can trigger the new build without the invalid refspec error.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, shell
Domain
ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.