Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ on:
type: number
default: 3

# Custom environment variables to inject into the jobs.
# Expected to be a JSON-formatted string.
# Example: '{"FIREBASE_APP_CHECK_BRANCH": "nc/target-split"}'
env_vars:
type: string
required: false
default: "{}"

# IMPORTANT: When adding new secrets to this workflow, update the
# 'has_secrets' logic in the 'check_secrets' job to include the new secret.
secrets:
Expand Down Expand Up @@ -96,6 +104,24 @@ jobs:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Set Custom Environment Variables
run: |
python3 -c '
import os, json
try:
env_vars = json.loads(os.environ.get("CUSTOM_ENV_VARS", "{}"))
if not isinstance(env_vars, dict):
raise ValueError("env_vars must be a JSON object")
with open(os.environ["GITHUB_ENV"], "a") as file:
for key, value in env_vars.items():
file.write(f"{key}={value}\n")
except json.JSONDecodeError:
print("Warning: env_vars is not valid JSON. Skipping.")
except Exception as error:
print(f"Error setting env vars: {error}")
'
env:
CUSTOM_ENV_VARS: ${{ inputs.env_vars }}
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
if: inputs.method != 'spm' && inputs.method != 'spmbuildonly' && inputs.method != 'cmake'
- name: Setup Bundler
Expand Down
Loading