Skip to content

Commit

Permalink
Change to hurl since special characters are messy on scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdappollonio committed Jul 30, 2024
1 parent b0a4324 commit 79d2c54
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/mirror-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,12 @@ jobs:
tar -xzf helm-push_0.10.4_linux_amd64.tar.gz
install -m 755 bin/helm-cm-push /usr/local/bin/helm-push
- name: "Install Hurl"
uses: gacts/install-hurl@v1

- name: "Validate Helm credentials"
run: |
response="$(curl -u "${HELM_REPO_USERNAME@Q}:${HELM_REPO_PASSWORD@Q}" -s -o /dev/null -w "%{http_code}" -X POST "$REGISTRY_DESTINATION/api/charts")"
if [ "$response" -ne 400 ]; then
echo "Expected HTTP status code 400, got $response"
exit 1
fi
responseBody="$(curl -s -X POST "$REGISTRY_DESTINATION/api/charts")"
error=$(echo "$responseBody" | jq -r '.error')
if [ "$error" != "EOF" ]; then
echo "Expected error message 'EOF', got '$error'"
exit 1
fi
hurl auth-test.hurl
env:
HELM_REPO_USERNAME: "${{ secrets.TEST_CHARTMUSEUM_USER }}"
HELM_REPO_PASSWORD: "${{ secrets.TEST_CHARTMUSEUM_PASSWORD }}"
Expand Down
7 changes: 7 additions & 0 deletions auth-test.hurl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
POST {{REGISTRY_DESTINATION}}/api/charts
[BasicAuth]
{{HELM_REPO_USERNAME}}: {{HELM_REPO_PASSWORD}}

HTTP 400
[Asserts]
jsonpath "$.error" == "EOF"

0 comments on commit 79d2c54

Please sign in to comment.