Skip to content

Commit 5027241

Browse files
authored
Merge pull request SvanBoxel#3 from masterleinad/master
Prepend branch name with repository name
2 parents 13f58d2 + 2ec0ff8 commit 5027241

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

entrypoint.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ POLL_TIMEOUT=${POLL_TIMEOUT:-$DEFAULT_POLL_TIMEOUT}
77

88
git checkout "${GITHUB_REF:11}"
99

10-
branch=$(git symbolic-ref --short HEAD)
10+
branch=${GITHUB_REPOSITORY}/$(git symbolic-ref --short HEAD)
1111

1212
sh -c "git config --global credential.username $GITLAB_USERNAME"
1313
sh -c "git config --global core.askPass /cred-helper.sh"
@@ -18,6 +18,9 @@ sh -c "git push mirror $branch"
1818

1919
sleep $POLL_TIMEOUT
2020

21+
# convert slashes in a HTML-compatible way
22+
branch=${branch//\//%2F}
23+
2124
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')
2225

2326
echo "Triggered CI for branch ${branch}"

0 commit comments

Comments
 (0)