Get output of a specific step in github actions

I have this file of GitHub action which runs tests, but now I am integrating slack notification in it. I want to get the output of the Run tests step and send it as a message in the slack step

  - name: Run tests
    run: |
      mix compile --warnings-as-errors
      mix format --check-formatted
      mix ecto.create
      mix ecto.migrate
      mix test
      MIX_ENV: test
      PGHOST: localhost
      PGUSER: postgres

  - name: Slack Notification
    uses: rtCamp/action-slack-notify@master
      SLACK_MESSAGE: Run tests output
      SLACK_TITLE: CI Test Suite
      SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

Any help will be much appreciated. Thanks

First save the test output to file:

mix test | tee test.log

And then sand content of that file in next step.

Thanks for your answer. I think this is the only way, but can you please guide about sending the contents of the file. I am little rusty with ubuntu.