Skip to content

Commit

Permalink
Fix empty inputs issue + validation check (#3)
Browse files Browse the repository at this point in the history
* Fix entrypoint.sh by adding missing "INPUT_" in front of each arg

* Move validate_inputs() prior any run of other functions
  • Loading branch information
DevGlitch authored Feb 14, 2024
1 parent c35a83d commit 17db67f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions action/check_alembic_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ def __init__(
self.db_name = db_name
self.migrations_path = migrations_path

validation_error = self._validate_inputs()
if validation_error:
raise ValueError(validation_error)

self.db_url = self._get_database_url()
self.engine = create_engine(self.db_url)

self._alembic_cfg = None
self._script_directory = None

validation_error = self._validate_inputs()
if validation_error:
raise ValueError(validation_error)

def _validate_inputs(self):
"""
Validates the necessary inputs for connecting to a database and accessing the migrations folder path.
Expand Down
2 changes: 1 addition & 1 deletion action/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh -l

python /check_alembic_migration.py "${DB_TYPE}" "${DB_HOST}" "${DB_PORT}" "${DB_USER}" "${DB_PASSWORD}" "${DB_NAME}" "${MIGRATIONS_PATH}"
python /check_alembic_migration.py "${INPUT_DB_TYPE}" "${INPUT_DB_HOST}" "${INPUT_DB_PORT}" "${INPUT_DB_USER}" "${INPUT_DB_PASSWORD}" "${INPUT_DB_NAME}" "${INPUT_MIGRATIONS_PATH}"

0 comments on commit 17db67f

Please sign in to comment.