From 89964788e11be9e39a6fa19edd0805820a28e8af Mon Sep 17 00:00:00 2001 From: Peter Baumgartner Date: Mon, 20 Jun 2022 10:15:03 -0600 Subject: [PATCH] Submit without signing Workaround for https://github.com/mozilla/web-ext/issues/804 --- .github/workflows/build.yml | 2 +- web-ext-submit | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 web-ext-submit diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6f18f6..85b2eba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }} diff --git a/web-ext-submit b/web-ext-submit new file mode 100755 index 0000000..8037130 --- /dev/null +++ b/web-ext-submit @@ -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