File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,10 @@ func (c *Compiler) generateGitPatchStep(yaml *strings.Builder) {
6262 yaml .WriteString (" else\n " )
6363 yaml .WriteString (" echo \" origin/$BRANCH_NAME does not exist, using merge-base with default branch\" \n " )
6464 yaml .WriteString (" # Get the default branch name\n " )
65- yaml .WriteString (" DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') \n " )
65+ yaml .WriteString (" DEFAULT_BRANCH=\" ${{ github.event.repository.default_branch }} \" \n " )
6666 yaml .WriteString (" echo \" Default branch: $DEFAULT_BRANCH\" \n " )
67+ yaml .WriteString (" # Fetch the default branch to ensure it's available locally\n " )
68+ yaml .WriteString (" git fetch origin $DEFAULT_BRANCH\n " )
6769 yaml .WriteString (" # Find merge base between default branch and current branch\n " )
6870 yaml .WriteString (" BASE_REF=$(git merge-base origin/$DEFAULT_BRANCH $BRANCH_NAME)\n " )
6971 yaml .WriteString (" echo \" Using merge-base as base: $BASE_REF\" \n " )
You can’t perform that action at this time.
0 commit comments