Closed kasperpeulen closed 1 year ago
Seems like grep should consider exclude head
?
@guitarrapc I think that should work yes!
By the way, can you clarify what happen when calling curl without head
, like below?
curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \
-H "Content-Type: application/json" \
-H "Circle-Token: $CIRCLE_CI_TOKEN" \
-d '{
"branch": "pull/19768",
"parameters": {
"workflow": "pr"
}
}'
@guitarrapc I get a 400:
{
"message" : "Branch not found"
}
Also the API documentation says to use: pull/<number>/head
https://circleci.com/docs/api/v2/index.html#operation/triggerPipeline
Thank you! I will fix it.
note: Before merging PR, I've try reproduce issue at my test lab but error not happen. Testing with following success.
CIRCLE_CI_TOKEN=YOUR_TOKEN
curl -X POST --location "https://circleci.com/api/v2/project/gh/guitarrapc/git-shallow-clone-test/pipeline" \
-H "Content-Type: application/json" \
-H "Circle-Token: $CIRCLE_CI_TOKEN" \
-d '{
"branch": "pull/2/head"
}'
ok, reproduced.
git-shallow-clone/checkout_advanced
.version: 2.1
orbs:
git-shallow-clone: guitarrapc/git-shallow-clone@2.4.0
jobs:
test:
docker:
- image: cimg/base:stable
steps:
- git-shallow-clone/checkout_advanced
- run: echo "this is the test job"
workflows:
build_and_test:
jobs:
- test
@kasperpeulen Hi, I've released v2.4.1 and confirm fixed on my lab. Please reopen if issue still exists.
version: 2.1
orbs:
git-shallow-clone: guitarrapc/git-shallow-clone@2.4.1
jobs:
test:
docker:
- image: cimg/base:stable
steps:
- git-shallow-clone/checkout_advanced
- run: echo "this is the test job"
workflows:
build_and_test:
jobs:
- test
Thanks,
Thanks! Trying it out now :)
When I run the API for a pull request:
I get an error in the shallow clone:
This line seems to be the problem: https://github.com/guitarrapc/git-shallow-clone-orb/blob/master/src/commands/checkout_advanced.yml#L103
I also tried calling the API with:
"branch": "pull/19768"
instead of"branch": "pull/19768"
but that gives me a branch not found error. (400)