fix: simplify Harbor secrets test - remove Docker commands
Some checks failed
Basil CI/CD Pipeline / Code Linting (push) Successful in 1m2s
Basil CI/CD Pipeline / Web Tests (push) Failing after 1m12s
Basil CI/CD Pipeline / API Tests (push) Failing after 1m22s
Test Harbor Secrets / Test Harbor Secret Access (push) Failing after 3s
Basil CI/CD Pipeline / Shared Package Tests (push) Successful in 57s
Basil CI/CD Pipeline / Security Scanning (push) Successful in 1m9s
Basil CI/CD Pipeline / Build All Packages (push) Has been skipped
Basil CI/CD Pipeline / E2E Tests (push) Has been skipped
Basil CI/CD Pipeline / Build & Push Docker Images (push) Has been skipped
Basil CI/CD Pipeline / Trigger Deployment (push) Has been skipped

- Removed Docker login and image pull steps (Docker not available in runner)
- Added Harbor API authentication test using curl with basic auth
- Test now validates secrets are accessible and credentials work
This commit is contained in:
2026-01-14 17:44:06 +00:00
parent 86368807bf
commit 025f900d5b

View File

@@ -60,39 +60,28 @@ jobs:
echo "⚠️ Harbor registry returned non-200 status (might be auth required)"
fi
- name: Test Docker login to Harbor
- name: Test Harbor API authentication
run: |
echo "=== Testing Docker Login to Harbor ==="
echo "=== Testing Harbor API Authentication ==="
if [ -z "${{ secrets.HARBOR_USERNAME }}" ] || [ -z "${{ secrets.HARBOR_PASSWORD }}" ]; then
echo "❌ Cannot test Docker login - secrets not set"
echo "❌ Cannot test Harbor API - secrets not set"
exit 1
fi
echo "${{ secrets.HARBOR_PASSWORD }}" | docker login $HARBOR_REGISTRY \
--username "${{ secrets.HARBOR_USERNAME }}" \
--password-stdin
# Test authenticated API call to Harbor
HTTP_CODE=$(curl -k -s -o /dev/null -w "%{http_code}" \
-u "${{ secrets.HARBOR_USERNAME }}:${{ secrets.HARBOR_PASSWORD }}" \
https://$HARBOR_REGISTRY/api/v2.0/projects)
if [ $? -eq 0 ]; then
echo "✅ Docker login to Harbor SUCCEEDED"
docker logout $HARBOR_REGISTRY
if [ "$HTTP_CODE" = "200" ]; then
echo "✅ Harbor API authentication SUCCEEDED (HTTP $HTTP_CODE)"
else
echo "❌ Docker login to Harbor FAILED"
echo "❌ Harbor API authentication FAILED (HTTP $HTTP_CODE)"
echo " This could mean credentials are incorrect or user lacks permissions"
exit 1
fi
- name: Test image pull
run: |
echo "=== Testing Image Pull from Harbor ==="
# Try to list repositories
echo "Attempting to pull hello-world to test registry access..."
# This will fail if no images exist, but tests connectivity
docker pull hello-world:latest || echo "Standard pull works"
echo "✅ Docker registry operations work"
- name: Summary
if: always()
run: |