Skip to content

Commit fd58280

Browse files
committed
Use main for version handling
- Fetch current chart version from main - Accept version update from release branch Signed-off-by: Yuval Turgeman <yturgema@redhat.com> Assisted-by: Claude
1 parent 6f93aa8 commit fd58280

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/create-release-pr.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ jobs:
3131
- name: Get current version
3232
id: current_version
3333
run: |
34-
version=$(grep '^version:' deploy/helm/rag/Chart.yaml | awk '{print $2}')
34+
# Get version from main branch since that's the source of truth for releases
35+
git fetch origin main
36+
version=$(git show origin/main:deploy/helm/rag/Chart.yaml | grep '^version:' | awk '{print $2}')
3537
echo "version=$version" >> $GITHUB_OUTPUT
3638
3739
- name: Calculate new version
@@ -71,6 +73,16 @@ jobs:
7173
git checkout -b release/v${{ steps.new_version.outputs.version }}
7274
git add deploy/helm/rag/Chart.yaml deploy/helm/rag/values.yaml
7375
git commit -m "chore: bump version to ${{ steps.new_version.outputs.version }}"
76+
77+
# Merge main into release branch to pre-resolve conflicts
78+
git fetch origin main
79+
git merge origin/main --no-edit || {
80+
# If conflicts occur, take our (release branch) version for Chart.yaml and values.yaml
81+
git checkout --ours deploy/helm/rag/Chart.yaml deploy/helm/rag/values.yaml
82+
git add deploy/helm/rag/Chart.yaml deploy/helm/rag/values.yaml
83+
git commit --no-edit
84+
}
85+
7486
git push origin release/v${{ steps.new_version.outputs.version }}
7587
7688
- name: Create Pull Request

0 commit comments

Comments
 (0)