Skip to content

Commit

Permalink
Should fix namespace issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolai Damm authored Mar 8, 2021
1 parent 0d93bd1 commit 6ab7ceb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ POLL_TIMEOUT=${POLL_TIMEOUT:-$DEFAULT_POLL_TIMEOUT}

git checkout "${GITHUB_REF:11}"

branch=${GITHUB_REPOSITORY}/$(git symbolic-ref --short HEAD)
branch="$(git symbolic-ref --short HEAD)"
branch_uri="$(urlencode ${branch})"

sh -c "git config --global credential.username $GITLAB_USERNAME"
sh -c "git config --global core.askPass /cred-helper.sh"
Expand All @@ -18,10 +19,7 @@ sh -c "git push mirror $branch"

sleep $POLL_TIMEOUT

# convert slashes in a HTML-compatible way
branch=${branch//\//%2F}

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')
pipeline_id=$(curl --header "PRIVATE-TOKEN: $GITLAB_PASSWORD" --silent "https://${GITLAB_HOSTNAME}/api/v4/projects/${GITLAB_PROJECT_ID}/repository/commits/${branch_uri}" | jq '.last_pipeline.id')

echo "Triggered CI for branch ${branch}"
echo "Working with pipeline id #${pipeline_id}"
Expand Down

0 comments on commit 6ab7ceb

Please sign in to comment.