Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions .github/workflows/check-snap-allowed-origins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Verify allowedOrigins in snap.manifest.json
- name: Verify allowedOrigins in snap manifest
shell: bash
run: |
set -euo pipefail
FILE="packages/snap/snap.manifest.json"

if [ ! -f "$FILE" ]; then
echo "::error title=Missing file::$FILE not found"
exit 1
fi

if ! command -v jq >/dev/null 2>&1; then
echo "Installing jq..."
Expand All @@ -36,18 +30,19 @@ jobs:
fi

expected='["https://webzjs.chainsafe.dev"]'
actual=$(jq -c '.initialPermissions["endowment:rpc"].allowedOrigins' "$FILE")
MANIFEST="packages/snap/snap.manifest.json"

if [ ! -f "$MANIFEST" ]; then
echo "::error title=Missing file::$MANIFEST not found"
exit 1
fi

echo "allowedOrigins in manifest: $actual"
actual=$(jq -c '.initialPermissions["endowment:rpc"].allowedOrigins' "$MANIFEST")
echo "allowedOrigins in $MANIFEST: $actual"

if [ "$actual" != "$expected" ]; then
echo "::error title=Invalid allowedOrigins::For merges to main, allowedOrigins must be $expected. Found: $actual"
if echo "$actual" | grep -qi "localhost"; then
echo "::error title=localhost detected::Remove any localhost origins from allowedOrigins."
fi
exit 1
fi

echo "allowedOrigins are valid."


2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ packages/web-wallet/dist/*
!packages/web-wallet/dist/_headers
!packages/web-wallet/dist/_redirects

# Local env overrides (dev proxy, etc.)
.env*.local
Loading