Skip to content

Commit f0051e4

Browse files
monkey666-crchenrun666
andauthored
fix(ci): sed only replaces first version tag in pom.xml (#13)
The previous sed replaced ALL <version> tags including plugin versions (e.g. bnd-maven-plugin 7.1.0 → 0.1.0). Use '0,/pattern/s/...' to only replace the first match which is the project version. Co-authored-by: chenrun666 <7417245+chenrun666@user.noreply.gitee.com>
1 parent 8fdb471 commit f0051e4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
VERSION=$(jq -r .version bazel-jdt-bridge/vscode-extension/package.json)
7070
echo "Syncing version: $VERSION"
7171
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" bazel-jdt-bridge/Cargo.toml
72-
sed -i "s|<version>[0-9][^<]*</version>|<version>$VERSION</version>|" bazel-jdt-bridge/java-bridge/pom.xml
72+
sed -i "0,/<version>[0-9][^<]*<\/version>/s|<version>[0-9][^<]*<\/version>|<version>$VERSION<\/version>|" bazel-jdt-bridge/java-bridge/pom.xml
7373
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
7474
7575
- name: Verify version synchronization

0 commit comments

Comments
 (0)