Skip to content

Commit 9a698c6

Browse files
evgenikoclaude
andcommitted
fix: improve dependabot config and auto-sync SDK overrides
Remove the wormhole-sdk group since it only contains one package (@wormhole-foundation/sdk), which made PR titles misleading (e.g. "32 updates" when only 1 dependency changed). Individual PRs will now have clear titles. Add a workflow to automatically update the overrides section (sdk, sdk-base, sdk-definitions) when dependabot bumps the main @wormhole-foundation/sdk version. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6345967 commit 9a698c6

2 files changed

Lines changed: 60 additions & 5 deletions

File tree

.github/dependabot.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,3 @@ updates:
1717
wormhole-ntt:
1818
patterns:
1919
- "@wormhole-foundation/sdk-*-ntt"
20-
wormhole-sdk:
21-
patterns:
22-
- "@wormhole-foundation/*"
23-
exclude-patterns:
24-
- "@wormhole-foundation/sdk-*-ntt"
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Update SDK Overrides
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "package.json"
7+
8+
permissions:
9+
contents: write
10+
pull-requests: read
11+
12+
jobs:
13+
update-overrides:
14+
if: github.actor == 'dependabot[bot]'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout PR branch
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.head_ref }}
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Update overrides to match SDK version
24+
run: |
25+
SDK_VERSION=$(jq -r '.dependencies["@wormhole-foundation/sdk"]' package.json)
26+
if [ "$SDK_VERSION" = "null" ] || [ -z "$SDK_VERSION" ]; then
27+
echo "No @wormhole-foundation/sdk dependency found, skipping."
28+
exit 0
29+
fi
30+
31+
CURRENT_OVERRIDE=$(jq -r '.overrides["@wormhole-foundation/sdk"]' package.json)
32+
if [ "$CURRENT_OVERRIDE" = "$SDK_VERSION" ]; then
33+
echo "Overrides already match SDK version ($SDK_VERSION), nothing to do."
34+
exit 0
35+
fi
36+
37+
echo "Updating overrides from $CURRENT_OVERRIDE to $SDK_VERSION"
38+
jq --arg v "$SDK_VERSION" '
39+
.overrides["@wormhole-foundation/sdk"] = $v |
40+
.overrides["@wormhole-foundation/sdk-base"] = $v |
41+
.overrides["@wormhole-foundation/sdk-definitions"] = $v
42+
' package.json > package.json.tmp && mv package.json.tmp package.json
43+
44+
- name: Check for changes
45+
id: diff
46+
run: |
47+
if git diff --quiet package.json; then
48+
echo "changed=false" >> "$GITHUB_OUTPUT"
49+
else
50+
echo "changed=true" >> "$GITHUB_OUTPUT"
51+
fi
52+
53+
- name: Commit updated overrides
54+
if: steps.diff.outputs.changed == 'true'
55+
run: |
56+
git config user.name "github-actions[bot]"
57+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
58+
git add package.json
59+
git commit -m "chore: sync overrides with @wormhole-foundation/sdk version"
60+
git push

0 commit comments

Comments
 (0)