Read pipeline status in "when: always"

I’ve got a some logic that executes in a when:

    steps:
      - run:
          name: Report outcome
          when: always
          command: |

I would like in my command block to determine if this has triggered from an on_success or on_fail. Documents dont define this, and the code block is really similar for both cases.

In the step before Report outcome, could you perhaps set an Env Var with a value and then read it in Report outcome?