GitHub Action : pass arbitrary text/variables between steps

Hi All,
I am using GitHub action to automate Postman test (newman run).
There are 2 steps in the action :

  • newman run
  • send email

How do I pass arbitrary strings/parameters (with certain test response payload) from newman run to send email? I was thinking about using os environment variables, however I do not know how to set them in the newman run step. Is it possible to get them from the newman run using --env-var?
Regards.

Hey @sergekurian :wave:

Welcome to the Postman Community! :postman:

Would you be able to provide more details of what you have set up and what you’re trying to do?

If you could share your workflow yml, that would be useful too.

The --env-var is only used to push external values into the Collection at runtime, to resolve a variable placeholder.

Hello @danny-dainton,
Thanks for your reply.

I end up setting global variables in request/test and exporting them into a file using newman run … --export-globals=/tmp/globals

Then using jq to retrieve values form the json file and setting them as GitHub environment variables using >> $GITHUB_ENV

And finally retrieving GitHub environment variables using β€œ${{ env.global_variable_name }}”

Regards

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.