Skip to content

Commit 46f525f

Browse files
committed
feat(ci): add env_vars input to _spm.yml workflow (#16152)
1 parent fa96c6e commit 46f525f

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

.github/workflows/_spm.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ jobs:
8888
env_vars = json.loads(os.environ.get("CUSTOM_ENV_VARS", "{}"))
8989
if not isinstance(env_vars, dict):
9090
raise ValueError("env_vars must be a JSON object")
91-
with open(os.environ["GITHUB_ENV"], "a") as f:
92-
for k, v in env_vars.items():
93-
f.write(f"{k}={v}\n")
91+
with open(os.environ["GITHUB_ENV"], "a") as file:
92+
for key, value in env_vars.items():
93+
file.write(f"{key}={value}\n")
9494
except json.JSONDecodeError:
9595
print("Warning: env_vars is not valid JSON. Skipping.")
96-
except Exception as e:
97-
print(f"Error setting env vars: {e}")
96+
except Exception as error:
97+
print(f"Error setting env vars: {error}")
9898
'
9999
env:
100100
CUSTOM_ENV_VARS: ${{ inputs.env_vars }}
@@ -144,13 +144,13 @@ jobs:
144144
env_vars = json.loads(os.environ.get("CUSTOM_ENV_VARS", "{}"))
145145
if not isinstance(env_vars, dict):
146146
raise ValueError("env_vars must be a JSON object")
147-
with open(os.environ["GITHUB_ENV"], "a") as f:
148-
for k, v in env_vars.items():
149-
f.write(f"{k}={v}\n")
147+
with open(os.environ["GITHUB_ENV"], "a") as file:
148+
for key, value in env_vars.items():
149+
file.write(f"{key}={value}\n")
150150
except json.JSONDecodeError:
151151
print("Warning: env_vars is not valid JSON. Skipping.")
152-
except Exception as e:
153-
print(f"Error setting env vars: {e}")
152+
except Exception as error:
153+
print(f"Error setting env vars: {error}")
154154
'
155155
env:
156156
CUSTOM_ENV_VARS: ${{ inputs.env_vars }}

0 commit comments

Comments
 (0)