-
Can you please attach an example project demonstrating this issue?
-
Made an example project and was able to reproduce the issue. The project doesn't have a job executor so you can't see the next step's error, but you can still see that the
code checkoutstep was missing the files in.git.Expected behavior in branch trigger ✅
Unexpected behavior in PR trigger ❌
-
This is expected behavior. Pull request build fires against merged commit of source and target branch. So there is no refs being checked out. You may add an additional command to switch to a branch for instance
git checkout -b devto force refs being populated.Also I'd suggest to add a repository checkout step in downstream jobs instead of publishing repository as artifacts and use it later.
-
Previous Value Current Value Open
Closed
-
Thanks for looking into it!
| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| Affected Versions |
12.0.1
|
| Labels |
No labels
|
I currently have
.onedev-buildspec.ymlset up so that on a PR or branch change, it'll trigger a job.However, I'm getting a failure on the PR job trigger. PR #2 and branch
pr-trigger-failare for the same code, so I think it's a bug that they're behaving differently.My code checkout step publishes all artifacts.
As a result, when I use the git repo in the next step, I get the error below.
I chased it down to the .git directory missing
.git/logs/refsand.git/refs. Why would these differ for the exact same repo on the same branch? To me it looks like the refs aren't getting included in the artifacts. Appreciate all guidance on the matter.