在GitHub Actions工作流程中有条件地设置环境变量

时间:2020-08-10 14:02:17

标签: github github-actions

我想根据分支设置环境变量。我有两个分支“ master”和“ develop”。在每种情况下,我都想定义以下工作流程env varialbes:

invokestatic

我该怎么做?

当前,我有两个文件,它们是彼此的副本,但只更改了env变量。

我已经看到您可以使用# for the master branch env: host: test.example.com compose_file: docker-compose.staging.yml # for the develop branch env: host: api.example.com compose_file: docker-compose.prod.yml 来评估表达式。那是路要走吗?

0 个答案:

没有答案