File tree Expand file tree Collapse file tree 4 files changed +42
-8
lines changed
Expand file tree Collapse file tree 4 files changed +42
-8
lines changed Original file line number Diff line number Diff line change 5555 id : apply
5656 run : |
5757 echo "::group::Applying schema changes"
58-
58+ echo "Running pgschema apply with detailed logging..."
59+
60+ # Enable detailed error reporting
61+ set -x # Show commands as they execute
62+
5963 # Run pgschema apply with auto-approve
6064 APPLY_OUTPUT=$(pgschema apply \
6165 --auto-approve \
@@ -67,11 +71,14 @@ jobs:
6771 --file "${{ github.workspace }}/multifile/main.sql" \
6872 --lock-timeout "30s" \
6973 --application-name "pgschema-github-action-apply" \
70- --format human 2>&1)
74+ 2>&1)
7175
7276 APPLY_EXIT_CODE=$?
77+
78+ set +x # Disable command tracing
7379
74- # Output the results
80+ echo "Apply exit code: $APPLY_EXIT_CODE"
81+ echo "Apply output:"
7582 echo "$APPLY_OUTPUT"
7683
7784 echo "::endgroup::"
Original file line number Diff line number Diff line change @@ -54,14 +54,21 @@ jobs:
5454 - name : Run pgschema plan
5555 id : plan
5656 run : |
57+ echo "Running pgschema plan with detailed logging..."
58+
59+ # Enable detailed error reporting
60+ set -x # Show commands as they execute
61+
5762 # Run pgschema plan
5863 PLAN_OUTPUT=$(pgschema plan \
5964 --host localhost \
6065 --port 5432 \
6166 --db testdb \
6267 --user postgres \
6368 --file "${{ github.workspace }}/multifile/main.sql" \
64- --format human 2>&1)
69+ 2>&1)
70+
71+ set +x # Disable command tracing
6572
6673 # Set output
6774 echo "plan<<EOF" >> $GITHUB_OUTPUT
Original file line number Diff line number Diff line change 5555 id : apply
5656 run : |
5757 echo "::group::Applying schema changes"
58-
58+ echo "Running pgschema apply with detailed logging..."
59+
60+ # Enable detailed error reporting
61+ set -x # Show commands as they execute
62+
5963 # Run pgschema apply with auto-approve
6064 APPLY_OUTPUT=$(pgschema apply \
6165 --auto-approve \
@@ -67,11 +71,14 @@ jobs:
6771 --file "${{ github.workspace }}/singlefile/schema.sql" \
6872 --lock-timeout "30s" \
6973 --application-name "pgschema-github-action-apply" \
70- --format human 2>&1)
74+ 2>&1)
7175
7276 APPLY_EXIT_CODE=$?
77+
78+ set +x # Disable command tracing
7379
74- # Output the results
80+ echo "Apply exit code: $APPLY_EXIT_CODE"
81+ echo "Apply output:"
7582 echo "$APPLY_OUTPUT"
7683
7784 echo "::endgroup::"
8390
8491 echo "exit_code=$APPLY_EXIT_CODE" >> $GITHUB_OUTPUT
8592
93+
8694 # Exit with the same code as pgschema
8795 exit $APPLY_EXIT_CODE
8896
@@ -101,3 +109,8 @@ jobs:
101109 echo "❌ Failed to apply schema changes!"
102110 echo ""
103111 echo "Please check the logs above for details."
112+ echo "Common issues:"
113+ echo "- Schema syntax errors"
114+ echo "- Database connection issues"
115+ echo "- Lock timeout exceeded"
116+ echo "- Incompatible schema changes"
Original file line number Diff line number Diff line change 5454 - name : Run pgschema plan
5555 id : plan
5656 run : |
57+ echo "Running pgschema plan with detailed logging..."
58+
59+ # Enable detailed error reporting
60+ set -x # Show commands as they execute
61+
5762 # Run pgschema plan
5863 PLAN_OUTPUT=$(pgschema plan \
5964 --debug \
6267 --db testdb \
6368 --user postgres \
6469 --file "${{ github.workspace }}/singlefile/schema.sql" \
65- --format human 2>&1)
70+ 2>&1)
71+
72+ set +x # Disable command tracing
6673
6774 # Set output
6875 echo "plan<<EOF" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments