Skip to content

Commit 124f0c1

Browse files
committed
ci(release): pin browser actions and add manifest verification
- Pin browser-actions/release-firefox-addon to v0.2.1 - Pin browser-actions/release-chrome-extension to v0.2.1 - Add Firefox manifest verification (check for background.scripts) - Add Chrome manifest verification (check for service_worker, no gecko settings) Addresses supply chain risk from unpinned @latest tags and adds safeguards against shipping wrong manifest to wrong browser store.
1 parent 66444d0 commit 124f0c1

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ jobs:
4444
- name: Build Firefox extension
4545
run: npm run build:prod:firefox
4646

47+
- name: Verify Firefox manifest
48+
run: |
49+
if ! grep -q '"scripts"' extension/manifest.json; then
50+
echo "::error::Firefox manifest not applied (missing background.scripts)"
51+
exit 1
52+
fi
53+
echo "✓ Firefox manifest verified"
54+
4755
- name: Create Firefox extension zip
4856
run: |
4957
cd extension
@@ -60,6 +68,18 @@ jobs:
6068
- name: Build Chrome extension
6169
run: npm run build:prod:chrome
6270

71+
- name: Verify Chrome manifest
72+
run: |
73+
if ! grep -q '"service_worker"' extension/manifest.json; then
74+
echo "::error::Chrome manifest not applied (missing background.service_worker)"
75+
exit 1
76+
fi
77+
if grep -q 'browser_specific_settings' extension/manifest.json; then
78+
echo "::error::Chrome manifest contains Firefox-specific settings"
79+
exit 1
80+
fi
81+
echo "✓ Chrome manifest verified"
82+
6383
- name: Create Chrome extension zip
6484
run: |
6585
cd extension
@@ -134,7 +154,7 @@ jobs:
134154
# Firefox Add-ons Publishing
135155
# =========================================================================
136156
- name: Publish to Firefox Add-ons
137-
uses: browser-actions/release-firefox-addon@latest
157+
uses: browser-actions/release-firefox-addon@v0.2.1
138158
with:
139159
addon-id: ${{ secrets.FIREFOX_ADDON_ID }}
140160
addon-path: light-session-${{ steps.version.outputs.VERSION }}-firefox.zip
@@ -146,7 +166,7 @@ jobs:
146166
# Chrome Web Store Publishing
147167
# =========================================================================
148168
- name: Publish to Chrome Web Store
149-
uses: browser-actions/release-chrome-extension@latest
169+
uses: browser-actions/release-chrome-extension@v0.2.1
150170
with:
151171
extension-id: ${{ secrets.CHROME_EXTENSION_ID }}
152172
extension-path: light-session-${{ steps.version.outputs.VERSION }}-chrome.zip

0 commit comments

Comments
 (0)