Skip to content

Commit

Permalink
Submit without signing
Browse files Browse the repository at this point in the history
Workaround for mozilla/web-ext#804
  • Loading branch information
ipmb committed Jun 20, 2022
1 parent 6321137 commit 8996478
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: NODE_ENV=dev npm ci
- name: Build Firefox extension
if: github.ref != 'refs/heads/manifest@v3'
run: npx web-ext sign --source-dir src --api-key="$API_KEY" --api-secret="$API_SECRET"
run: ./web-ext-submit --source-dir src --api-key="$API_KEY" --api-secret="$API_SECRET"
env:
API_KEY: ${{ secrets.MOZ_API_KEY }}
API_SECRET: ${{ secrets.MOZ_API_SECRET }}
Expand Down
16 changes: 16 additions & 0 deletions web-ext-submit
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /bin/bash
# via https://github.com/fregante/web-ext-submit/blob/04dc976c65f0954b6184447c0fa8ee5c315c080e/extender.sh
# find location of web-ext (dependency)
cd "$(dirname "$0")/$(dirname "$(readlink "$0")")" || exit
PATH=$(npm bin):$PATH
cd - > /dev/null || exit

# redirect 'sign'+output parsing
set -- "sign" "${@:1}" # https://stackoverflow.com/a/4827707/288906
tmp="$(mktemp)"
ok="Your add-on has been submitted for review."
web-ext "$@" | sed -n "s/\($ok\).*$/\0/;1,/$ok/p" | tee "$tmp"
error=${PIPESTATUS[0]}
if ! grep -q "$ok" "$tmp" && [ $error = 1 ] ; then
exit $error
fi

0 comments on commit 8996478

Please sign in to comment.