From c0173072e24a0e6ece2d4e163a72d0219f7dd1b0 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Wed, 24 Feb 2021 21:10:21 +0100 Subject: [PATCH] sync_repo_files: Normalize usage of git_user Fix ./scripts/sync_repo_files.sh: line 141: GITHUB_USER: unbound variable Signed-off-by: Julien Pivotto --- scripts/sync_repo_files.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/sync_repo_files.sh b/scripts/sync_repo_files.sh index e48084856..10efa0f79 100755 --- a/scripts/sync_repo_files.sh +++ b/scripts/sync_repo_files.sh @@ -45,10 +45,10 @@ push_branch() { # stdout and stderr are redirected to /dev/null otherwise git-push could leak # the token in the logs. # Delete the remote branch in case it was merged but not deleted. - git push --quiet "https://${GITHUB_TOKEN}:@github.com/${1}" \ + git push --quiet "https://${git_user}:${GITHUB_TOKEN}:@github.com/${1}" \ ":${branch}" 1>/dev/null 2>&1 git push --quiet \ - "https://${GITHUB_TOKEN}:@github.com/${1}" \ + "https://${git_user}:${GITHUB_TOKEN}:@github.com/${1}" \ --set-upstream "${branch}" 1>/dev/null 2>&1 } @@ -137,7 +137,7 @@ for org in ${orgs}; do fetch_repos "${org}" | while read -r repo; do # Check if a PR is already opened for the branch. prLink=$(curl --show-error --silent \ - -u "${GITHUB_USER}:${GITHUB_TOKEN}" \ + -u "${git_user}:${GITHUB_TOKEN}" \ "https://api.github.com/repos/${org}/${repo}/pulls?head=${repo}:${branch}" | jq '.[0].url') if [[ "${prLink}" != "null" ]]; then echo "Pull request already opened for branch '${branch}': ${prLink}"