@@ -18,7 +18,7 @@ sh -c "git push mirror $branch"
18
18
19
19
sleep $POLL_TIMEOUT
20
20
21
- pipeline_id=$( curl --header " PRIVATE-TOKEN: $GITLAB_PASSWORD " " https://${GITLAB_HOSTNAME} /api/v4/projects/${GITLAB_PROJECT_ID} /repository/commits/${branch} " | jq ' .last_pipeline.id' )
21
+ pipeline_id=$( curl --header " PRIVATE-TOKEN: $GITLAB_PASSWORD " --silent " https://${GITLAB_HOSTNAME} /api/v4/projects/${GITLAB_PROJECT_ID} /repository/commits/${branch} " | jq ' .last_pipeline.id' )
22
22
23
23
echo " Triggered CI for branch ${branch} "
24
24
echo " Working with pipeline id #${pipeline_id} "
36
36
if [ " $ci_status " = " running" ]
37
37
then
38
38
echo " Checking GitLab pipeline status..."
39
- curl --silent - d ' {"state":"pending", "target_url": "' ${ci_web_url} ' ", "context": "gitlab-ci"}' -H " Authorization: token ${GITHUB_TOKEN} " -H " Accept: application/vnd.github.antiope-preview+json" -X POST " https://api.github.com/repos/${GITHUB_REPOSITORY} /statuses/${GITHUB_SHA} " > /dev/null
39
+ curl -d ' {"state":"pending", "target_url": "' ${ci_web_url} ' ", "context": "gitlab-ci"}' -H " Authorization: token ${GITHUB_TOKEN} " -H " Accept: application/vnd.github.antiope-preview+json" -X POST --silent " https://api.github.com/repos/${GITHUB_REPOSITORY} /statuses/${GITHUB_SHA} " > /dev/null
40
40
fi
41
41
done
42
42
43
43
echo " GitLab pipeline finished with status ${ci_status} "
44
44
45
45
if [ " $ci_status " = " success" ]
46
46
then
47
- curl -d ' {"state":"success", "target_url": "' ${ci_web_url} ' ", "context": "gitlab-ci"}' -H " Authorization: token ${GITHUB_TOKEN} " -H " Accept: application/vnd.github.antiope-preview+json" -X POST " https://api.github.com/repos/${GITHUB_REPOSITORY} /statuses/${GITHUB_SHA} "
47
+ curl -d ' {"state":"success", "target_url": "' ${ci_web_url} ' ", "context": "gitlab-ci"}' -H " Authorization: token ${GITHUB_TOKEN} " -H " Accept: application/vnd.github.antiope-preview+json" -X POST --silent " https://api.github.com/repos/${GITHUB_REPOSITORY} /statuses/${GITHUB_SHA} "
48
48
exit 0
49
49
elif [ " $ci_status " = " failed" ]
50
50
then
51
- curl -d ' {"state":"failure", "target_url": "' ${ci_web_url} ' ", "context": "gitlab-ci"}' -H " Authorization: token ${GITHUB_TOKEN} " -H " Accept: application/vnd.github.antiope-preview+json" -X POST " https://api.github.com/repos/${GITHUB_REPOSITORY} /statuses/${GITHUB_SHA} "
51
+ curl -d ' {"state":"failure", "target_url": "' ${ci_web_url} ' ", "context": "gitlab-ci"}' -H " Authorization: token ${GITHUB_TOKEN} " -H " Accept: application/vnd.github.antiope-preview+json" -X POST --silent " https://api.github.com/repos/${GITHUB_REPOSITORY} /statuses/${GITHUB_SHA} "
52
52
exit 1
53
53
fi
0 commit comments