File tree Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 8080 done
8181 # Create the test database
8282 docker exec $(docker compose ps -q mysql) mysql -uroot -e "CREATE DATABASE testdb;"
83+ # Test connection from host
84+ echo "Testing connection from host..."
85+ mysql -h localhost -P 3306 -u root -e "SHOW DATABASES;" || echo "Direct connection failed, but that's OK if mysqldef can connect"
8386
8487 - name : Preview MySQL schema changes
8588 uses : ./
Original file line number Diff line number Diff line change @@ -337,6 +337,18 @@ async function run() {
337337 const baselineConfig = { ...config };
338338 baselineConfig.args = baselineConfig.args.map((arg) => (arg === schemaFile ? actualBaselineFile : arg));
339339 core.info("Applying baseline schema to database");
340+ // Debug: Log environment variables being set
341+ if (baselineConfig.env) {
342+ const sanitizedEnv = { ...baselineConfig.env };
343+ // Mask any password values for security
344+ if ('MYSQL_PWD' in sanitizedEnv) {
345+ sanitizedEnv.MYSQL_PWD = sanitizedEnv.MYSQL_PWD ? '***' : '(empty)';
346+ }
347+ if ('PGPASSWORD' in sanitizedEnv) {
348+ sanitizedEnv.PGPASSWORD = sanitizedEnv.PGPASSWORD ? '***' : '(empty)';
349+ }
350+ core.debug(`Environment variables: ${JSON.stringify(sanitizedEnv)}`);
351+ }
340352 try {
341353 await runSqldef(binaryPath, baselineConfig);
342354 }
Original file line number Diff line number Diff line change @@ -339,6 +339,18 @@ async function run(): Promise<void> {
339339 baselineConfig . args = baselineConfig . args . map ( ( arg ) => ( arg === schemaFile ? actualBaselineFile : arg ) ) ;
340340
341341 core . info ( "Applying baseline schema to database" ) ;
342+ // Debug: Log environment variables being set
343+ if ( baselineConfig . env ) {
344+ const sanitizedEnv = { ...baselineConfig . env } ;
345+ // Mask any password values for security
346+ if ( "MYSQL_PWD" in sanitizedEnv ) {
347+ sanitizedEnv . MYSQL_PWD = sanitizedEnv . MYSQL_PWD ? "***" : "(empty)" ;
348+ }
349+ if ( "PGPASSWORD" in sanitizedEnv ) {
350+ sanitizedEnv . PGPASSWORD = sanitizedEnv . PGPASSWORD ? "***" : "(empty)" ;
351+ }
352+ core . debug ( `Environment variables: ${ JSON . stringify ( sanitizedEnv ) } ` ) ;
353+ }
342354 try {
343355 await runSqldef ( binaryPath , baselineConfig ) ;
344356 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments