首页 > 解决方案 > 如何从 bash 命令分配环境变量

问题描述

我有一个包含所有环境变量的配置文件,而不是手动分配每个环境变量,我想使用 bash 从我的文件中读取

name: Integration 
on: [push]
jobs:
  tests:
    runs-on: ubuntu-latest

    services:
      mysql:
        image: mysql:8
        env:
          MYSQL_DATABASE: $(value from bash script)

我见过的所有指南都只展示了如何使用预定义的环境变量,而没有使用动态值

标签: githubgithub-actions

解决方案


推荐阅读