From eb86a498ddeb8fc3337df77494813f89e0ad59ae Mon Sep 17 00:00:00 2001 From: nrnrk Date: Tue, 13 Feb 2024 09:58:42 +0900 Subject: [PATCH] ci: fix CI scripts for main branch case Fix the issue of failure of the CI script when the current branch is main. This was caused by use of undeclared variable `repository`. --- ci-find-smithy-go.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ci-find-smithy-go.sh b/ci-find-smithy-go.sh index d6e16712f95..c1e2346cf64 100755 --- a/ci-find-smithy-go.sh +++ b/ci-find-smithy-go.sh @@ -18,6 +18,12 @@ if [ -z "$RUNNER_TMPDIR" ]; then exit 1 fi +if [ -n "$GIT_PAT" ]; then + repository=https://$GIT_PAT@github.com/$SMITHY_GO_REPOSITORY +else + repository=https://github.com/$SMITHY_GO_REPOSITORY +fi + branch=$(git branch --show-current) if [ "$branch" == main ]; then echo aws-sdk-go-v2 is on branch main @@ -31,12 +37,6 @@ if [ -z "$branch" ]; then branch=$GITHUB_HEAD_REF fi -if [ -n "$GIT_PAT" ]; then - repository=https://$GIT_PAT@github.com/$SMITHY_GO_REPOSITORY -else - repository=https://github.com/$SMITHY_GO_REPOSITORY -fi - echo on branch \"$branch\" while [ -n "$branch" ] && [[ "$branch" == *-* ]]; do echo looking for "$branch"...