File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,14 +23,18 @@ kubectl config set-context --current --namespace="$NS"
2323
2424# Add support for Github PR, which do not have a branch name in the git repository
2525if [ " ${GITHUB_EVENT_NAME:- } " = " pull_request" ]; then
26- revision=" $GITHUB_HEAD_REF "
26+ revision=" ${GITHUB_HEAD_REF} "
27+ # During a PR, the git repository containing the CI code is the forked one
28+ git_repo=$( jq -r ' .pull_request.head.repo.full_name' " $GITHUB_EVENT_PATH " )
2729else
28- revision=" $SPARKMEASURE_WORKBRANCH "
30+ revision=" ${SPARKMEASURE_WORKBRANCH:- main} "
31+ git_repo=" ${GITHUB_REPOSITORY} "
2932fi
33+ git_repo=" https://github.com/${git_repo} "
3034
31- argocd app create $app_name --dest-server https://kubernetes.default.svc \
35+ argocd app create " $app_name " --dest-server https://kubernetes.default.svc \
3236 --dest-namespace " $app_name " \
33- --repo https://github.com/k8s-school/ $app_name \
37+ --repo " $git_repo " \
3438 --path e2e/charts/apps --revision " $revision " \
3539 -p spec.source.targetRevision.default=" $revision "
3640
You can’t perform that action at this time.
0 commit comments