Skip to content

Commit ee73781

Browse files
committed
Change folder name and replaced sed by yq
1 parent a0a47fe commit ee73781

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

.github/workflows/sdlc-sdk-update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
_SDK_PACKAGE: ${{ inputs.sdk-package }}
8989
_SDK_VERSION: ${{ inputs.sdk-version }}
9090
run: |
91-
./scripts/update-sdk-version.sh "$_SDK_PACKAGE" "$_SDK_VERSION"
91+
./Scripts/update-sdk-version.sh "$_SDK_PACKAGE" "$_SDK_VERSION"
9292
9393
- name: Create branch and commit
9494
env:
@@ -117,7 +117,7 @@ jobs:
117117
NEW_SDK_GIT_REF=$(echo "$_SDK_VERSION" | cut -d'-' -f3-)
118118
PR_BODY="Updates the SDK version from \`$_OLD_SDK_VERSION\` to \`$_SDK_PACKAGE $_SDK_VERSION\`
119119
120-
## What's Changed
120+
## What's Changed"
121121
122122
# Use echo -e to interpret escape sequences and pipe to gh pr create
123123
PR_URL=$(echo -e "$PR_BODY" | gh pr create \

Scripts/update-sdk-version.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Script to update SDK version in project-bwa.yml, project-bwk.yml and project-pm.ym
3+
# Script to update SDK version in project-bwa.yml, project-bwk.yml and project-pm.yml
44
# Usage: ./Scripts/update-sdk-version.sh <sdk-package> <sdk-version>
55
# ./Scripts/update-sdk-version.sh BitwardenSdk 2a6609428275c758fcda5383bfb6b3166ec29eda
66

@@ -23,11 +23,7 @@ FILES=(
2323
for file in "${FILES[@]}"; do
2424
if [[ -f "$file" ]]; then
2525
echo "🔧 Updating revision in $file..."
26-
sed -i.bak -E "/^packages:/,/^[^[:space:]]/ {
27-
/$SDK_PACKAGE:/,/^[[:space:]]{2}[[:alnum:]]/ {
28-
s/^([[:space:]]{4}revision: ).*/\1$SDK_VERSION/
29-
}
30-
}" "$file"
26+
yq -i ".packages[\"$SDK_PACKAGE\"].revision = \"$SDK_VERSION\"" "$file"
3127
echo "✅ Updated revision line:"
3228
grep "revision:" "$file"
3329
else

0 commit comments

Comments
 (0)