Skip to content

Commit eec2340

Browse files
add github test token
1 parent 5562d9e commit eec2340

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

share/ci/git_rebase.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ cd $CI_PROJECT_DIR
1111

1212
github_group_repo="ComputationalRadiationPhysics/gitlab-ci-testproject"
1313

14+
echo "$GITHUB_TOKEN" > tmp.txt
15+
cat tmp.txt
16+
1417
pr_id=$(echo "$CI_BUILD_REF_NAME" | cut -d"/" -f1 | cut -d"-" -f2)
1518
#curl -X GET https://api.github.com/repos/${github_group_repo}/pulls/${pr_id}
16-
target_branch=$(curl -X GET https://api.github.com/repos/${github_group_repo}/pulls/${pr_id} 2>/dev/null| python3 -c 'import json,sys;obj=json.loads(sys.stdin.read());print(obj["base"]["ref"])')
19+
curl_data=$(curl -u psychocoderHPC:$GITHUB_TOKEN -X GET https://api.github.com/repos/${github_group_repo}/pulls/${pr_id} 2>/dev/null)
20+
echo -e "$curl_data"
21+
target_branch=$(echo -e "$curl_data" | python3 -c 'import json,sys;obj=json.loads(sys.stdin.read());print(obj["base"]["ref"])')
1722
echo "target_branch=${target_branch}"
1823

1924
mainline_exists=$(git remote -v | cut -f1 | grep mainline -q && echo 0 || echo 1)

0 commit comments

Comments
 (0)