Open Spomky opened 1 year ago
I've seen this a number of times now: I think the action is not fetching all branches :thinking:
I modified the action to make sure all branches are fetched. Unfortunately, the result is the same.
This does not make much sense. It tries to create new default branch from latest release branch not taking into account release major version. If release happened for previous major like 3.10.0 while 4.0.x branch exists it attempts to create new default branch from 4.0.x. I wonder what new branch name is, I suspect it is 3.11.x meaning major changes can get backported on branch switch.
I looked closely at this issue. I am pretty sure I know what is going on here.
Checkout action by default does depth 1 shallow checkout. Doing git fetch
in shallow repository prevents fetching refs that are not in .git/shallow
.
https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt---update-shallow
--update-shallow
By default when fetching from a shallow repository, git fetch refuses refs that require updating .git/shallow. This option updates .git/shallow and accepts such refs.
Since release normally happens from latest release branch it ends up available in happy path condition. However, when latest available release branch is for the next major it is not fetched to local repository which causes this failure.
It is for the good actually. If not for this bug the more sinister bug would have been uncovered: next minor branch for current major would have been created from the next major branch.
Fix here is two-fold:
--unshallow
to git fetch
in SwitchDefaultBranchToNextMinor
command. I like former approach better.
Bug Report
Summary
Job is failing: https://github.com/web-token/jwt-framework/actions/runs/5016108869/jobs/8992552443 Previous executions were fine: https://github.com/web-token/jwt-framework/actions/runs/4392789931/jobs/7692769201 No changes in the Github Action file. I cannot find what is missing.
Current behavior
Github Action fails with the following error code and detail.
How to reproduce
The error is issued during normal Github Action call.
Expected behavior
The branch '4.0.x' already exists. It is expected for the action to correctly find it and continue its execution.