File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
testflows/github/hetzner/runners Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 2626from .config import read , write
2727from .config import parse_config
2828from .config import default_user_config
29+ from .config import config_vars
Original file line number Diff line number Diff line change 2929
3030default_user_config = os .path .expanduser ("~/.github-hetzner-runners/config.yaml" )
3131
32+ # store all the environment variables used inside the config file
33+ config_vars = {}
34+
3235
3336def env_constructor (loader , node ):
3437 value = loader .construct_scalar (node )
@@ -39,6 +42,7 @@ def env_constructor(loader, node):
3942 False
4043 ), f"environment variable ${ group } used in the config is not defined"
4144 value = value .replace (f"${{{ group } }}" , env_value )
45+ config_vars [group ] = env_value
4246 return value
4347
4448
Original file line number Diff line number Diff line change 2121
2222from .actions import Action
2323from .logger import decode_message
24+ from .config import config_vars
2425
2526
2627def command_options (
@@ -115,8 +116,14 @@ def install(args, config):
115116 f"Environment=GITHUB_TOKEN={ config .github_token } \n "
116117 f"Environment=GITHUB_REPOSITORY={ config .github_repository } \n "
117118 f"Environment=HETZNER_TOKEN={ config .hetzner_token } \n "
118- f"ExecStart={ binary } "
119119 )
120+ # add all other environment variables used inside the config file
121+ for var , value in config_vars .items ():
122+ if var in ["GITHUB_TOKEN" , "GITHUB_REPOSITORY" , "HETZNER_TOKEN" ]:
123+ continue
124+ contents += f"Environment={ var } ={ value } \n "
125+
126+ contents += f"ExecStart={ binary } "
120127 contents += f" --ssh-key { config .ssh_key } "
121128 contents += command_options (config )
122129 contents += "\n " "[Install]\n " "WantedBy=multi-user.target\n "
You can’t perform that action at this time.
0 commit comments