Skip to content

Commit

Permalink
Allow GH actions from forked repos
Browse files Browse the repository at this point in the history
Refs: cnti-testcatalog#2066

Signed-off-by: Martin Matyas <[email protected]>
  • Loading branch information
martin-mat committed Jun 20, 2024
1 parent 01464d0 commit cf5d40d
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,27 +167,13 @@ jobs:
export PROTECTED_DOCKERHUB_EMAIL=${EMAIL_ARRAY[$RANDOMIZER]}
export PROTECTED_IMAGE_REPO=${IMAGE_ARRAY[$RANDOMIZER]}
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
source cluster.env
export KUBECONFIG=$(pwd)/$CLUSTER.conf
until [[ $(kubectl get pods -l app=local-path-provisioner --namespace=local-path-storage -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') == "True" ]]; do
echo "Waiting for local-path-storage"
sleep 1
done
LOCAL_PATH_STORAGE_POD=$(kubectl get pods -l app=local-path-provisioner --namespace=local-path-storage -o jsonpath='{range .items[*]}{.metadata.name}')
# until [[ $(kubectl exec -ti $LOCAL_PATH_STORAGE_POD --namespace=local-path-storage -- apk add curl jq) ]]; do
# echo "Failed to install packages, retrying"
# sleep 1
#done
CLUSTER_RATE_LIMIT=$(kubectl exec -ti $LOCAL_PATH_STORAGE_POD --namespace=local-path-storage -- curl --head -H "Authorization: Bearer $(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest | grep ratelimit-remaining || true)
TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token || true)
ANONYMOUS_RUNNER_RATE_LIMIT=$(curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest | grep ratelimit-remaining || echo "Runner Rate Limit Exceeded: $RUNNER_NAME")
TOKEN=$(curl --user "$DOCKERHUB_USERNAME:$DOCKERHUB_PASSWORD" "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
AUTH_RATE_LIMIT=$(curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest | grep ratelimit-remaining || echo "Authenticated Rate Limit Exceeded")
echo "RUNNER RATE LIMIT: $ANONYMOUS_RUNNER_RATE_LIMIT"
echo "CLUSTER RATE LIMIT: $CLUSTER_RATE_LIMIT"
echo "DOCKER USER RATE LIMIT: $AUTH_RATE_LIMIT"
crystal build src/cnf-testsuite.cr
./cnf-testsuite setup
Expand Down Expand Up @@ -283,15 +269,6 @@ jobs:
sleep 1
done
CLUSTER_RATE_LIMIT=$(kubectl run -i tmp-shell --restart=Never --rm --image ubuntu -- /bin/bash -c "apt update && apt install -y curl jq; curl --head -H \"Authorization: Bearer $(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)\" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest" | grep ratelimit-remaining || true)
TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token || true)
ANONYMOUS_RUNNER_RATE_LIMIT=$(curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest | grep ratelimit-remaining || echo "Runner Rate Limit Exceeded: $RUNNER_NAME")
TOKEN=$(curl --user "$DOCKERHUB_USERNAME:$DOCKERHUB_PASSWORD" "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)
AUTH_RATE_LIMIT=$(curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest | grep ratelimit-remaining || echo "Authenticated Rate Limit Exceeded")
echo "RUNNER RATE LIMIT: $ANONYMOUS_RUNNER_RATE_LIMIT"
echo "CLUSTER RATE LIMIT: $CLUSTER_RATE_LIMIT"
echo "DOCKER USER RATE LIMIT: $AUTH_RATE_LIMIT"
LOG_LEVEL=info crystal spec --warnings none --tag ${{ matrix.tag }} -v
Expand Down

0 comments on commit cf5d40d

Please sign in to comment.