Skip to content

Commit 00e93fc

Browse files
ekampfclaude
andauthored
fix: redirect log output to stderr to prevent invalid format errors (#67)
* debug * fix: redirect log output to stderr to prevent invalid format errors Fixes issue where debug mode caused 'Invalid format' errors in GitHub Actions output. The log function was writing to stdout, causing debug messages to contaminate function return values captured via command substitution. This resulted in malformed GITHUB_OUTPUT entries when debug mode was enabled. Redirecting to stderr follows Unix conventions and matches the Windows implementation behavior. Fixes #66 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * try * try * Revert "try" This reverts commit e4677b8. * Revert "try" This reverts commit 55b0aa4. * fix: add fallback for inputs.debug in integration tests Add default value 'false' for inputs.debug to prevent undefined values when workflow is triggered by push events instead of workflow_dispatch. Also add debug parameter to test-windows job for consistency. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 9edd425 commit 00e93fc

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/integration-tests.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
branches:
66
- 'main'
77
workflow_dispatch:
8+
inputs:
9+
debug:
10+
description: 'Enable debug mode'
11+
required: false
12+
default: 'false'
813

914
jobs:
1015
test-linux:
@@ -30,6 +35,7 @@ jobs:
3035
uses: twingate/github-action@main
3136
with:
3237
service-key: ${{ secrets[matrix.service-key] }}
38+
debug: ${{ inputs.debug || 'false' }}
3339

3440
- name: Verify Twingate status
3541
run: twingate status
@@ -64,6 +70,7 @@ jobs:
6470
uses: twingate/github-action@main
6571
with:
6672
service-key: ${{ secrets[matrix.service-key] }}
73+
debug: ${{ inputs.debug || 'false' }}
6774

6875
- name: Access a secure resource
6976
shell: powershell

scripts/linux-helpers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ log() {
88
if [ "$level" = "DEBUG" ] && [ "$DEBUG_MODE" != "true" ]; then
99
return
1010
fi
11-
echo "[$level] $@"
11+
echo "[$level] $@" >&2
1212
}
1313

1414
get_twingate_version() {

0 commit comments

Comments
 (0)