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

fix: properly parse special characters in repo URL#127

Merged
wei merged 1 commit intorepo-sync:masterfrom
m4heshd:special-char-fix
Jan 21, 2023
Merged

fix: properly parse special characters in repo URL#127
wei merged 1 commit intorepo-sync:masterfrom
m4heshd:special-char-fix

Conversation

@m4heshd
Copy link
Copy Markdown
Contributor

@m4heshd m4heshd commented Jan 21, 2023

This PR adds the ability to parse any character included in the repo owner's name and the repo name.

Fixes #126.

The test log is available here. The repo name used for the test contains all sorts of allowed nasty special characters 😁. This test additionally covers the edge case where .git also happens to be in the middle of the repo name (the actual reason for the run mentioned in #126 to fail).

@wei
Copy link
Copy Markdown
Member

wei commented Jan 21, 2023

Could you write out some test cases you've been testing with?

@m4heshd
Copy link
Copy Markdown
Contributor Author

m4heshd commented Jan 21, 2023

@wei Edited the original post. 👆🏽

@dcrossleyau
Copy link
Copy Markdown

Actually the only unusual character in our repo name is the dot. That is common to lots of repository names. (Also the .git is at the end is common.)

@m4heshd
Copy link
Copy Markdown
Contributor Author

m4heshd commented Jan 21, 2023

Also the .git is at the end is common.

It is indeed. But that was already handled by the regex I've previously written in v2.12. In this case, your repo name has .github in the middle which means regex finds the .git in there. That's why it was parsed as folio-org/folio-org and ultimately failed.

Edit:
I'm gonna improve my explanation a bit there. The previous regex was written to find the first dot and the assumption was to have git present after that. So the dot in the .github was picked up instead. New expressions are written to have much better clarity.

@dcrossleyau
Copy link
Copy Markdown

Ah, i understand now. Also a very common repo name to contain .github.io

Anyway, thanks again for this wonderful Action. It makes our life so much easier.

@wei wei merged commit 7e79a9f into repo-sync:master Jan 21, 2023
@wei
Copy link
Copy Markdown
Member

wei commented Jan 21, 2023

amazing, thanks for the fix. This is now released as repo-sync/pull-request@v2.12.1 and repo-sync/pull-request@v2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect DESTINATION_REPOSITORY value with release v2.12

3 participants