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
6 changes: 3 additions & 3 deletions .github/workflows/check-snap-allowed-origins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
pull_request:
branches: [ main ]
paths:
- 'packages/snap/snap.manifest.json'
- 'packages/snap/snap.manifest.base.json'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this workflow should check original snap.manifest.json

- '.github/workflows/check-snap-allowed-origins.yml'
push:
branches: [ main ]
paths:
- 'packages/snap/snap.manifest.json'
- 'packages/snap/snap.manifest.base.json'

jobs:
check-allowed-origins:
Expand All @@ -22,7 +22,7 @@ jobs:
shell: bash
run: |
set -euo pipefail
FILE="packages/snap/snap.manifest.json"
FILE="packages/snap/snap.manifest.base.json"

if [ ! -f "$FILE" ]; then
echo "::error title=Missing file::$FILE not found"
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/check-snap-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: Check Snap Manifest
on:
pull_request:
paths:
- 'packages/snap/snap.manifest.json'
- 'packages/snap/snap.manifest.base.json'
- '.github/workflows/check-snap-manifest.yml'
push:
branches:
- main
- master
paths:
- 'packages/snap/snap.manifest.json'
- 'packages/snap/snap.manifest.base.json'
- '.github/workflows/check-snap-manifest.yml'

jobs:
Expand All @@ -32,15 +32,15 @@ jobs:
fi

# Extract allowedOrigins from the manifest
ALLOWED_ORIGINS=$(jq -r '.initialPermissions."endowment:rpc".allowedOrigins[]' snap.manifest.json)
echo "Current allowedOrigins in snap.manifest.json:"
ALLOWED_ORIGINS=$(jq -r '.initialPermissions."endowment:rpc".allowedOrigins[]' snap.manifest.base.json)

echo "Current allowedOrigins in snap.manifest.base.json:"
echo "$ALLOWED_ORIGINS"

# Check if localhost is present
if echo "$ALLOWED_ORIGINS" | grep -q "localhost"; then
echo "❌ ERROR: localhost found in allowedOrigins. This should not be in production!"
echo "Please ensure snap.manifest.json only contains production URLs."
echo "Please ensure snap.manifest.base.json only contains production URLs."
echo "Expected: [\"https://webzjs.chainsafe.dev\"]"
exit 1
fi
Expand All @@ -60,5 +60,5 @@ jobs:
exit 1
fi

echo "✅ SUCCESS: snap.manifest.json has correct allowedOrigins configuration"
echo "✅ SUCCESS: snap.manifest.base.json has correct allowedOrigins configuration"
echo "Found: https://webzjs.chainsafe.dev"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ packages/web-wallet/dist/*
!packages/web-wallet/dist/_headers
!packages/web-wallet/dist/_redirects

# Generated snap manifest (production uses snap.manifest.base.json)
packages/snap/snap.manifest.json

Loading