Fix bug in ITEM_NOT_UPDATABLE error check

stderr redirection to the cws-log.txt left the uploadcmd.stderr value
empty, so the ITEM_NOT_UPDATABLE error check didn't work. This is fixed
by redirecting both stderr to stdout and running tee on stdout.

Bug: twpowertools:20
Change-Id: I186036dc4e0b2717e6b8f1b44d9c3b9537761f7b
diff --git a/.zuul.yaml b/.zuul.yaml
index 56396ee..1526247 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -1,3 +1,11 @@
+# == Zuul configuration file ==
+#
+# This file is used to configure this project and its associated jobs in Zuul.
+# Zuul is the CI/CD tool which lets us check changes before they are committed,
+# and build a canary version of the extension on a regular basis.
+#
+# More info about Zuul: https://zuul-ci.org/docs/zuul/
+
 - job:
     name: infinitegforums-lint
     parent: web-ext-lint
diff --git a/roles/cws-publish/tasks/main.yaml b/roles/cws-publish/tasks/main.yaml
index 1c79986..6a4b82f 100644
--- a/roles/cws-publish/tasks/main.yaml
+++ b/roles/cws-publish/tasks/main.yaml
@@ -30,13 +30,15 @@
 - name: Upload and publish the ZIP file to the Chrome Web Store
   when: not (dry_run|bool)
   ansible.builtin.shell:
-    cmd: >
-      chrome-webstore-upload upload --auto-publish --extension-id {{ extension_id }}
-      --source {{ zip_file.stdout|quote }} --client-id {{ credentials.clientId|quote }}
-      --refresh-token {{ credentials.refreshToken|quote }}
-      2>cws-log.txt
+    cmd: |
+      set -o pipefile
+      chrome-webstore-upload upload --auto-publish --extension-id {{ extension_id }} \
+          --source {{ zip_file.stdout|quote }} \
+          --client-id {{ credentials.clientId|quote }} \
+          --refresh-token {{ credentials.refreshToken|quote }} \
+          |& tee cws-log.txt
     chdir: "{{ zuul.project.src_dir }}/out"
   no_log: True
   register: uploadcmd
   failed_when:
-    - not (uploadcmd.rc == 0 or ('ITEM_NOT_UPDATABLE' in uploadcmd.stderr))
+    - not (uploadcmd.rc == 0 or ('ITEM_NOT_UPDATABLE' in uploadcmd.stdout))