Skip to content

Commit 132475b

Browse files
committed
chore: separate version bump chlog gen into script for testing
1 parent fb04183 commit 132475b

2 files changed

Lines changed: 45 additions & 12 deletions

File tree

.github/workflows/ci-bump-component-versions.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,7 @@ jobs:
152152
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
153153
run: |
154154
make install-tools
155-
filepath=$(make -s chlog-new)
156-
157-
# The .issues field is automatically populated by the make target if a PR has been created prior
158-
yq -i '
159-
.change_type = "enhancement" |
160-
.component = "distributions" |
161-
.note = "Bump otel component versions from ${{ env.current_beta_core }} to ${{ env.next_beta_core }}" |
162-
... comments=""
163-
' "$filepath"
164-
165-
echo "New changelog entry added:"
166-
cat "$filepath"
155+
./scripts/generate-version-bump-chlog.sh -c "${{ env.current_beta_core }}" -n "${{ env.next_beta_core }}"
167156
168157
- name: Commit changelog entry
169158
if: ${{ !env.ACT && steps.bump_component_versions.outputs.has_changes == 'true' }}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
# Copyright New Relic, Inc. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Generates a changelog entry for an otel component version bump.
6+
#
7+
# Must be run after the PR is created so that `make chlog-new` can populate the
8+
# .issues field with the PR number.
9+
#
10+
# Usage: generate-version-bump-chlog.sh -c <current_beta_core> -n <next_beta_core>
11+
# -c current otel beta core version (e.g. v0.147.0)
12+
# -n next otel beta core version (e.g. v0.148.0)
13+
14+
set -e
15+
16+
CURRENT_BETA_CORE=''
17+
NEXT_BETA_CORE=''
18+
19+
while getopts c:n: flag
20+
do
21+
case "${flag}" in
22+
c) CURRENT_BETA_CORE=${OPTARG};;
23+
n) NEXT_BETA_CORE=${OPTARG};;
24+
*) exit 1;;
25+
esac
26+
done
27+
28+
if [[ -z "$CURRENT_BETA_CORE" || -z "$NEXT_BETA_CORE" ]]; then
29+
echo "Usage: $0 -c <current_beta_core> -n <next_beta_core>" >&2
30+
exit 1
31+
fi
32+
33+
filepath=$(make -s chlog-new)
34+
35+
# The .issues field is automatically populated by the make target if a PR has been created prior
36+
yq -i "
37+
.change_type = \"enhancement\" |
38+
.component = \"distributions\" |
39+
.note = \"Bump otel component versions from ${CURRENT_BETA_CORE} to ${NEXT_BETA_CORE}\" |
40+
... comments=\"\"
41+
" "$filepath"
42+
43+
echo "New changelog entry added:"
44+
cat "$filepath"

0 commit comments

Comments
 (0)