Skip to content

[Feature/Docs] How to pass GitHub actions environment variables to the running container? #200

@barbeque

Description

@barbeque

Is this feature missing in the latest version?

  • I'm using the latest release

Is your feature request related to a problem? Please describe.

I have been running tests against a webpage, and it works great, but now I would like to take advantage of the GitHub actions secrets for things like account passwords.

I can't figure out a way to pass environment variables to the Puppeteer runner. I've tried:

  • env statements in the job step itself (don't seem to show up in process.env)
  • Writing secrets to a text file (text files don't appear to get copied into the runner's home directory)

Describe the solution you'd like?

If possible, please update the test.yml example workflow to include a way to pass an environment variable from GitHub Actions into the script being run with Puppeteer inside the container.

Describe alternatives you've considered?

One idea I had was using the docker-run action to force a text file to appear in there, but it feels like this might make the actions file convoluted. At the moment, the environment variables are hardcoded into the JS file, which is not great for "secrets."

Anything else?

I am fairly new to GitHub Actions, so it's possible there's something in the documentation that I've missed. Thanks for your time!

Also the greetings job on this repo failed, it seems like it can't get ahold of the assert module.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions