Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

pedroroccon's avatar

API tokens and Github Actions (CI)

Greetings!

I'm developing a Laravel project that consumes an API. The API (PagSeguro) has it own page to generate private tokens. Those tokens are stored in my .env file.

Well, I have some automated tests in my application. One of these tests are testing if I can connect to my API, so I will need my token to test it. When I run tests in local development, everything passes, but when I push it to Github, it fails because it recreates the .env file without my API token.

Anyone knows how I can store safetly my tokens in Github Actions?

Regards!

0 likes
0 replies

Please or to participate in this conversation.