Skip to content

Commit 0ce98f6

Browse files
committed
manually fix CHANGELOG conflicts
1 parent ed12ab7 commit 0ce98f6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/post-release-version-bump.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
version:
77
description: 'Version number (e.g., 1.0.1)'
88
required: true
9+
is_patch:
10+
description: 'Is this a patch? (true or false)'
11+
required: true
12+
default: 'false'
913

1014
env:
1115
AWS_DEFAULT_REGION: us-east-1
@@ -100,8 +104,19 @@ jobs:
100104
sed -i 's/__version__ = ".*"/__version__ = "'$DEV_VERSION'"/' aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py
101105
VERSION="${{ github.event.inputs.version }}"
102106
sed -i 's/python:v.*"/python:v'$VERSION'"/' .github/workflows/daily-scan.yml
107+
108+
# for patch releases, avoid merge conflict by manually resolving CHANGELOG with main
109+
if [[ "${{ github.event.inputs.is_patch }}" == "true" ]]; then
110+
git fetch origin main
111+
git show origin/main:CHANGELOG.md | sed -n '/## Unreleased/,/^## v[0-9]/p' | sed '$d' | tail -n +2 | sed '/^$/d' > /tmp/unreleased_content.txt
112+
113+
# Insert the content right after the existing "## Unreleased" header
114+
sed -i '/## Unreleased/r /tmp/unreleased_content.txt' CHANGELOG.md
115+
fi
116+
103117
git add aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py
104118
git add .github/workflows/daily-scan.yml
119+
git add CHANGELOG.md
105120
git commit -m "Prepare main for next development cycle: Update version to $DEV_VERSION"
106121
git push --set-upstream origin "prepare-main-for-next-dev-cycle-${VERSION}"
107122

0 commit comments

Comments
 (0)