@@ -18,7 +18,7 @@ sh -c "git push mirror $branch"
1818
1919sleep $POLL_TIMEOUT
2020
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' )
2222
2323echo " Triggered CI for branch ${branch} "
2424echo " Working with pipeline id #${pipeline_id} "
3636 if [ " $ci_status " = " running" ]
3737 then
3838 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
4040 fi
4141done
4242
4343echo " GitLab pipeline finished with status ${ci_status} "
4444
4545if [ " $ci_status " = " success" ]
4646then
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} "
4848 exit 0
4949elif [ " $ci_status " = " failed" ]
5050then
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} "
5252 exit 1
5353fi
0 commit comments