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
25 changes: 20 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
with:
version: 2024.08.0
license: ${{ secrets.CONNECT_LICENSE }}
# If this were not quoted in bash -c before running, $CONNECT_API_KEY
# If this were not quoted before running, $CONNECT_API_KEY
# would evaluate before with-connect defines it.
command: 'curl -f -H "Authorization: Key $CONNECT_API_KEY" $CONNECT_SERVER/__api__/v1/content'

Expand All @@ -44,9 +44,17 @@ jobs:
version: 2024.08.0
license: ${{ secrets.CONNECT_LICENSE }}
command: |
echo "Testing multiline command support"
curl -f -H "Authorization: Key $CONNECT_API_KEY" $CONNECT_SERVER/__api__/v1/content
echo 'Multiline test passed'
set -euo pipefail
echo "Testing multiline command with various quote types"
RESPONSE=$(curl -f -H "Authorization: Key $CONNECT_API_KEY" $CONNECT_SERVER/__api__/v1/content)
# The response should be an empty JSON array since no content has been deployed
echo "Response: $RESPONSE"
[ "$RESPONSE" = "[]" ] || exit 1
# Test that single quotes work in commands
TEST_STRING='This contains single quotes'
echo "TEST_STRING value: $TEST_STRING"
[ "$TEST_STRING" = "This contains single quotes" ] || exit 1
echo "✓ Multiline test passed - variables, single quotes, and double quotes all work"

test-cli:
runs-on: ubuntu-latest
Expand All @@ -65,4 +73,11 @@ jobs:
- name: Test with-connect CLI
run: |
with-connect --version 2024.08.0 -- \
bash -c 'curl -f -H "Authorization: Key $CONNECT_API_KEY" $CONNECT_SERVER/__api__/v1/content'
bash -c '
set -euo pipefail
RESPONSE=$(curl -f -H "Authorization: Key $CONNECT_API_KEY" $CONNECT_SERVER/__api__/v1/content)
# The response should be an empty JSON array since no content has been deployed
echo "Response: $RESPONSE"
[ "$RESPONSE" = "[]" ] || exit 1
echo "✓ CLI test passed - got valid JSON response"
'
4 changes: 3 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ runs:
fi
done <<< "${{ inputs.env }}"
fi
with-connect $ARGS -- bash -c "$1" _ "${{ inputs.command }}"
with-connect $ARGS -- bash <<'SCRIPT'
${{ inputs.command }}
SCRIPT
Comment on lines +60 to +62
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting. I didn't the start/end tags of here docs were arbitrary. I thought it had to be EOF.