-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GHES support. Allow projects outside github.com #210
Conversation
@@ -4,7 +4,7 @@ import * as github from '@actions/github' | |||
// TODO: Ensure this (and the Octokit client) works for non-git.luolix.top URLs, as well. | |||
// https://github.com/orgs|users/<ownerName>/projects/<projectNumber> | |||
const urlParse = | |||
/^(?:https:\/\/)?github\.com\/(?<ownerType>orgs|users)\/(?<ownerName>[^/]+)\/projects\/(?<projectNumber>\d+)/ | |||
/^(?:https:\/\/)?[^/]+\/(?<ownerType>orgs|users)\/(?<ownerName>[^/]+)\/projects\/(?<projectNumber>\d+)/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The (?:https:\/\/)?[^/]+
part of this expression seems like it could be buggy. If the URL protocol is https://
it will work fine, but if it's anything else (like http://
), the first group will pass because it's optional and then the [^/]
part will unexpectedly stop at the first forward-slash, which will be in the protocol.
Maybe we shouldn't have a 'beginning-of-string' part of the regex at all? It doesn't seem to really matter what goes before or after the part of the URL we care about. That seems like it would allow us to make a more robust regex that just searches anywhere in the string for a /orgs/*/projects/*
match:
\/(?<ownerType>orgs|users)\/(?<ownerName>[^/]+)\/projects\/(?<projectNumber>\d+)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iansan5653 Anyway I got an answer that this action not working with GHES. But this change will be needed 100% :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, I forgot the new Projects hasn't shipped to GHES yet 😄
I'm going to close this PR for now but we can revisit & reopen it once that's shipped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any issues with this idea. Have you been able to test to make sure it does work with GHES after this change?
There is a comment on line 5 and an error message on line 82 we should update as well
I'm trying to use this action on GHES, and I see there's a strict URL match for github.com projects though the domain isn't use thereafter.