Skip to content
Merged
Show file tree
Hide file tree
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
33 changes: 0 additions & 33 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,36 +169,3 @@ runs:
run: |
cd ${{ github.action_path }}
poetry run python main.py
env:
GIT_URL: ${{ inputs.git_url }}
GIT_AUTH_METHOD: ${{ inputs.git_auth_method }}
GIT_TOKEN: ${{ inputs.git_token }}
GIT_USER: ${{ inputs.git_user }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_ACTOR: ${{ github.actor }}
GIT_SSH_KEY: ${{ inputs.git_ssh_key }}
DEPLOYMENT_TYPE: ${{ inputs.deployment_type }}
ENVIRONMENT: ${{ inputs.environment }}
REMOTE_USER: ${{ inputs.remote_user }}
REMOTE_HOST: ${{ inputs.remote_host }}
REMOTE_DIR: ${{ inputs.remote_dir }}
SSH_KEY: ${{ inputs.ssh_key }}
REMOTE_PASSWORD: ${{ inputs.remote_password }}
REGISTRY_TYPE: ${{ inputs.registry_type }}
REGISTRY_USERNAME: ${{ inputs.registry_username }}
REGISTRY_PASSWORD: ${{ inputs.registry_password }}
AWS_REGION: ${{ inputs.aws_region }}
AWS_ACCOUNT_ID: ${{ inputs.aws_account_id }}
PROFILE: ${{ inputs.profile }}
DEPLOY_COMMAND: ${{ inputs.deploy_command }}
K8S_MANIFEST_PATH: ${{ inputs.k8s_manifest_path }}
K8S_NAMESPACE: ${{ inputs.k8s_namespace }}
USE_SUDO: ${{ inputs.use_sudo }}
ENV_FILES_GENERATE: ${{ inputs.env_files_generate }}
ENV_FILES_STRUCTURE: ${{ inputs.env_files_structure }}
ENV_FILES_PATH: ${{ inputs.env_files_path }}
ENV_FILES_PATTERNS: ${{ inputs.env_files_patterns }}
ENV_FILES_CREATE_ROOT: ${{ inputs.env_files_create_root }}
ENV_FILES_FORMAT: ${{ inputs.env_files_format }}
COPY_ARTIFACTS: ${{ inputs.copy_artifacts }}
GITHUB_WORKSPACE: ${{ github.workspace }}
2 changes: 1 addition & 1 deletion changelogs/2026-01-29_20-04-22.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
- **Documentation Updates**: The `README.md` and `docs/env-generation.md` have been updated to reflect the new environment variable management approach and the removal of the `env_blob` input.

### Removed
- The `env_blob` input from `action.yml` has been removed. Its functionality is now superseded by the enhanced capabilities of the `ENV` secret for passing raw environment variable blocks and templating.
- The `env_blob` input from `action.yml` has been removed. Its functionality is now superseded by the enhanced capabilities of the `ENV` secret for passing raw environment variable blocks and templating.
10 changes: 10 additions & 0 deletions changelogs/2026-01-29_20-18-38.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

## [Unreleased]

### Changed
- **Improved Configuration Input Handling**: The action's core script now directly retrieves GitHub Action inputs using their standard `INPUT_` prefix (e.g., `inputs.git_url` is accessed as `INPUT_GIT_URL`). This refactoring simplifies the `action.yml` definition and makes the input parsing more direct and robust.
- **Internal Refactoring**: An internal variable (`env_blob_key` to `comp_env_key`) within the environment variable merging logic was renamed for improved clarity and maintainability. This change does not alter user-facing behavior.

### Removed
- Explicit environment variable mappings for action inputs from `action.yml`. This removal is a direct consequence of the improved configuration input handling, as inputs are now read directly by the action's script.
11 changes: 10 additions & 1 deletion src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ def get_bool_env(name, default="false"):
return str(val).lower() == "true"

def get_env(name, default=None):
return overrides.get(name) or os.getenv(name, default)
# 1. Check overrides
val = overrides.get(name)
if val is not None:
return val
# 2. Check direct environment
val = os.getenv(name)
if val is not None:
return val
# 3. Check GitHub Action Input (INPUT_NAME)
return os.getenv(f"INPUT_{name.upper()}") or default

# Configuration from environment variables
self.GIT_URL_ENV = get_env("GIT_URL", "").strip()
Expand Down
10 changes: 5 additions & 5 deletions src/env_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,15 @@ def merge_env_vars_by_priority(
merged[key] = v

# D. Env Specific Blob (e.g. ENV_PROD_APP)
env_blob_key = f"ENV_{env_upper}_{file_base}"
if env_blob_key in all_env_vars:
parsed = parse_all_in_one_secret(all_env_vars[env_blob_key], config.ENV_FILES_FORMAT)
comp_env_key = f"ENV_{env_upper}_{file_base}"
if comp_env_key in all_env_vars:
parsed = parse_all_in_one_secret(all_env_vars[comp_env_key], config.ENV_FILES_FORMAT)
if parsed:
for pk, pv in parsed.items():
p_key = pk[len(f"{file_base}_") :] if pk.startswith(f"{file_base}_") else pk
merged[p_key] = pv
elif all_env_vars[env_blob_key].strip():
merged[file_base] = all_env_vars[env_blob_key]
elif all_env_vars[comp_env_key].strip():
merged[file_base] = all_env_vars[comp_env_key]

return merged

Expand Down