0

I want to run some test cases on GitHub action when pull request is sent. I have some env variables which are used in various files. I faced an issue to read env variables from only one file, which is docker-compose.yml.

how can I read that within GitHub action?

my docker-compose.yml and action.yml files are here:

https://gist.github.com/ashiqdev/21781af493f156aca32313b68aedbc74

Ashik
  • 2,888
  • 8
  • 28
  • 53

1 Answers1

0

Lack of knowledge of GitHub actions blocks the exact answer for this question. Instead i have a suggestion for you.

What if you store your variables not in docker-compose.yml file, but to store references to actual env variables, that you would pass withing the file?

For example, you could store all env vars in .env file, and docker-compose will use it by default. source

Also, you could specify different env-files for your docker-compose services, with this.

That will let you to use docker-compose variables the same way as you do with other env-files.