Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
fix: properly parse special characters in repo URL (#127)
Browse files Browse the repository at this point in the history
Fixes #126.
  • Loading branch information
m4heshd authored Jan 21, 2023
1 parent 5723317 commit 7e79a9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ echo_info "DESTINATION_BRANCH=$DESTINATION_BRANCH"
# Determine repository url
if [[ -z "$INPUT_DESTINATION_REPOSITORY" ]]; then
# Try to query local repository's remote url if INPUT_DESTINATION_REPOSITORY is null
CHECKOUT_REPOSITORY=$(git remote get-url origin | sed -r -e 's:https\://([^/]+)/([^/]+)/([^.]+)(.*):\2\/\3:g' -e 's:git@([^/]+)\:([^/]+)/([^.]+)(.*):\2\/\3:g')
CHECKOUT_REPOSITORY=$(git remote get-url origin | sed -r -e 's:(\.git$)::g' -e 's:https\://([^/]+)/([^/]+)/(.*):\2\/\3:g' -e 's:git@([^/]+)\:([^/]+)/(.*):\2\/\3:g')
fi

# Fallback to GITHUB_REPOSITORY if both INPUT_DESTINATION_REPOSITORY and CHECKOUT_REPOSITORY are unavailable
Expand Down

0 comments on commit 7e79a9f

Please sign in to comment.