diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index b02d99e7cc..7c0f2d26ae 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -102,3 +102,16 @@ jobs: run: | curl -X POST --data-urlencode "payload={\"text\": \"Reviewdog failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}" $SLACK_WEBHOOK if: ${{ failure() && (contains(github.ref_name, 'rel/nightly') || contains(github.ref_name, 'rel/beta') || contains(github.ref_name, 'rel/stable') || contains(github.ref_name, 'master')) }} + reviewdog-shellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: shellcheck + uses: reviewdog/action-shellcheck@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: "github-pr-check" + shellcheck_flags: "-e SC2034,SC2046,SC2053,SC2207,SC2145 -S warning" + fail_on_error: true + path: | + test/scripts/e2e_subs diff --git a/test/scripts/e2e_subs/goal-partkey-commands.sh b/test/scripts/e2e_subs/goal-partkey-commands.sh index b333a0e8aa..7d7154ec7b 100755 --- a/test/scripts/e2e_subs/goal-partkey-commands.sh +++ b/test/scripts/e2e_subs/goal-partkey-commands.sh @@ -83,16 +83,22 @@ verify_registered_state () { SEARCH_INVOKE_CONTEXT=$(echo "$3" | xargs) # look for participation ID anywhere in the partkeyinfo output - PARTKEY_OUTPUT=$(${gcmd} account partkeyinfo) - if ! echo "$PARTKEY_OUTPUT" | grep -q -F "$SEARCH_KEY"; then - fail_test "Key $SEARCH_KEY was not installed properly for cmd '$SEARCH_INVOKE_CONTEXT':\n$PARTKEY_OUTPUT" + info_temp_file=$(mktemp) + ${gcmd} account partkeyinfo > "${info_temp_file}" + if ! grep -q -F "$SEARCH_KEY" "${info_temp_file}"; then + echo "info_temp_file contents:" + cat "${info_temp_file}" + fail_test "Key $SEARCH_KEY was not installed properly for cmd '$SEARCH_INVOKE_CONTEXT'" fi # looking for yes/no, and the 8 character head of participation id in this line: # yes LFMT...RHJQ 4UPT6AQC... 4 0 3000 - LISTKEY_OUTPUT=$(${gcmd} account listpartkeys) - if ! echo "$LISTKEY_OUTPUT" | grep -q "$SEARCH_STATE.*$(echo "$SEARCH_KEY" | cut -c1-8)"; then - fail_test "Unexpected key $SEARCH_KEY state (looked for $SEARCH_STATE ) for cmd '$SEARCH_INVOKE_CONTEXT':\n$LISTKEY_OUTPUT" + list_temp_file=$(mktemp) + ${gcmd} account listpartkeys > "${list_temp_file}" + if ! grep -q "$SEARCH_STATE.*$(echo "$SEARCH_KEY" | cut -c1-8)" "${list_temp_file}"; then + echo "list_temp_file contents:" + cat "${list_temp_file}" + fail_test "Unexpected key $SEARCH_KEY state (looked for $SEARCH_STATE ) for cmd '$SEARCH_INVOKE_CONTEXT'" fi }